Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: Paul Roberts on May 08, 2015, 03:20:18 PM

Title: Scripts for RailClone
Post by: Paul Roberts on May 08, 2015, 03:20:18 PM
In this sticky topic we encourage you to share any intersting scripts or tools that you've created to make working with RailClone even easier.

If you'd like to share your work with the community, just feel free to upload or link to your script with a a brief description below.

Many thanks!

Paul

Disclaimer: Any scripts uploaded to this thread by the iToo Software team are not supported officially by iToo, please use at your own risk.
Title: Re: Scripts for RailClone
Post by: Paul Roberts on May 08, 2015, 03:24:07 PM
Reverse Spline

(http://lonelymonk.com/forum_images/6450ee7b2a644d958449682d7c76fcc7.jpg)

I'll kick this off with a small script that allows you to reverse the direction of a spline without losing the placement of the material IDs.

Normally the material IDs on a apline are allocated according the the vertex number so if a spline is reversed, the IDs are too. This can be a problem if you are using a RailClone object that uses the IDs to place segments. This script allows you to apply a standard reverse operation, reverse the spline maintaining the ID placement, or just reverse the IDs on their own.

To use it:



I hope you find it useful.

Many thanks,

Paul
Title: Re: Scripts for RailClone
Post by: Paul Roberts on May 08, 2015, 04:02:24 PM
RailClone Slicer

(http://content.screencast.com/users/Paul-Roberts/folders/Snagit/media/790f5d6c-95a9-428c-8160-e43395019433/05.08.2015-14.29.png)

This script allows you to slice an existing mesh into segments ready to be used by RailClone's 1D or 2D Arrays. It does this by adding and controlling a number of slice modifiers, then automatically cloning and splitting the mesh to create a number of segments.  To use it:



The script resets the pivots by adding an XForm operator to the geometry when it is picked, so you need to ensure it is aligned correctly in relation to the world coords. Remember the L1S generator uses the X Axis to build the Array and A2S use the X and Y. Even if your final style will be oriented differently, for example a vertical wall style, the segment's pivots will still need to be oriented to these axes.

(http://docs.itoosoft.com/download/attachments/16744475/image2015-3-22%2015%3A27%3A53.png?version=1&modificationDate=1428487024904&api=v2)

You can read more about this here (http://docs.itoosoft.com/download/attachments/16744475/image2015-3-22%2015%3A27%3A53.png?version=1&modificationDate=1428487024904&api=v2).

I have included a global size parameter for the Row's height. If you turn this off you can adjust the size of each row independently but be aware of the fact that the height of each row will always be determined by its largest segment (http://docs.itoosoft.com/display/RAILCLONE/9+-+Create+your+first+2D+array). 

If you would rather position the slice planes manually, just pick and adjust them from the modifier stack, the segments should still be created correctly when you click Slice Geometry.

Hope someone finds it handy!

Many thanks,

Paul
Title: Re: Scripts for RailClone
Post by: KN1988 on May 17, 2015, 12:36:13 AM
Hi,

Sorry if this is the wrong topic.
My first try for a simple script (never done this before). Got some code from other scripts and changed an combined it.

I wanted to animate Railclone object visibility. Therefore in the Railclone object display setting, the instance engine had to be turned off.
I had to go trough a lot of files and each file had a lot of grouped railclone objects.Therefore this simple script:
- A button to open all groups and sub-groups
- A button to sellect all railclone objects
- A button to turn the instance engine off and a button to turn it off.

Please use at own risk. I'm no experienced scripter....
Last line of code can be deleted by the way.
Title: Re: Scripts for RailClone
Post by: Shawn Olson on May 18, 2015, 02:07:40 AM
This script does interact with RC directly, but I added support for RC Pro in Wall Worm's (http://dev.wallworm.com/) VMF Exporter for the Source Engine. In essence, it allows level designers to build complex world geometry for the game level layout. I'm working on a way to utilize RC for prop distribution as well... not sure if the functions/parameters I need have all been exposed to MAXScript yet, which is part of what is holding that aspect back.
Title: Re: Scripts for RailClone
Post by: Paul Roberts on August 11, 2015, 12:51:59 PM
V-Ray Proxy Cloner
A little Maxscript to help create proxies with offset times for use in RailClone. Set the number of Clones to create using the Count parameter and the time between them using Frames Offset.

(http://i.imgur.com/IaXbG2t.png)
Title: Re: Scripts for RailClone
Post by: Paul Roberts on August 25, 2015, 10:12:19 PM
For an explanation of when this might be useful, see this thread (http://forum.itoosoft.com/index.php?topic=3065.0).

I realised it's a bit tedious to instance multi-texture materials into a large number of mult-sub slots so here's a little script to automate it.

Multi-Sub Instancer
(http://i.imgur.com/dh7vxdc.png)

This will instance the Material in the ID slot specified in ID of Mat to Copy to the IDs between the range defined by ID Range Start and ID Range End. Just set the values, make sure the multi-sub material is the active slot in the material editor and hit Instance to ID Slots

Be careful though, the script will overwrite any existing materials in the specified ID range, and once you've run the script you can't undo.

Hope it helps someone.

Cheers!

Paul
Title: Re: Scripts for RailClone
Post by: Paul Roberts on January 04, 2016, 06:30:47 PM
RCquickApply

A quick script to speed up applying simple library styles to a spline. Using it you should be able to create a new RC object, select a Library style and apply it to a selected spline in just a few clicks:

(http://i.imgur.com/7YowOjJ.png)

To use:


If no spline was selected it'll create a RC object and open the library browser, but the option to apply to spline will not be available.

Obviously this will only work for styles that require a single spline input - for more complex styles with multiple inputs you may find it's easier to just use the first button and apply the spline from the Base Objects rollout.


Paul
Title: Re: Scripts for RailClone
Post by: RobH2 on January 10, 2016, 09:13:15 PM
I can't figure out how to see '.ms' scripts in 'Customize' so I made the 'RailCloneSlicer v01' into an '.mcr'

Now, just drag the '.mcr' into Max then go to 'Customize' and in the 'Category' named 'RC Scripts' you'll see 'railCloneSlicer_RH' . Drag that to a toolbar or use 'Menus' to add it to a menu.

Title: Re: Scripts for RailClone
Post by: Paul Roberts on January 14, 2016, 11:17:30 AM
Apply RC to Poly


This script allows you to apply a RailClone object automatically to selected polygons, it's useful for cquickly creating walls and cladding. Here's a quick demo:



The script works by automatically extracting a closed spline from each polygon. It then duplicates the selected RC object, orientates it so that it is aligned with the polygon's surface normal and finally assigns the spline to the RailClone object's Clipping path. In most cases you should find this means you don't need a surface if the spline is flat, if not you may still need to add a surface to get the correct shape.

To use it:



I hope it might be helpful. Please let me know if you have any questions.

Many thanks!

Paul
Title: Re: Scripts for RailClone
Post by: Macker on January 26, 2016, 10:30:44 AM
Wow, these are some great scripts! Thanks!

If only everyone knew how to code. But then I suppose we wouldn't need you chaps to produce such great plugins if that were the case!
Title: Re: Scripts for RailClone
Post by: antmarch on January 29, 2016, 05:11:38 PM
Apply to poly script  is a timesaver indeed!

 Thanks very much for these guys!
Title: Re: Scripts for RailClone
Post by: Macker on March 03, 2016, 08:36:06 PM
I've been using the script to create a railclone object on a surface, but I'm having problems with a roof - it's got holes for rooflights, and it doesn't like it.
Title: Re: Scripts for RailClone
Post by: Paul Roberts on March 03, 2016, 11:27:58 PM
Could you upload your roof surface?  I'll check it out.

 Thanks !

Paul
Title: Re: Scripts for RailClone
Post by: Macker on March 04, 2016, 10:04:15 AM
Sure, here it is. Maybe I've just built the style wrong?
Title: Re: Scripts for RailClone
Post by: Paul Roberts on March 04, 2016, 10:54:03 AM
Hi!,

It look as though you haven't turned on Extend X/Y Size to area in the generator's setting.

(http://i.imgur.com/vU1nGLS.png)

This option automatically derives the size of the array from the Clipping spline, ensuring it is large enough to fill the whole area.

I hope that helps,

Thanks!

Paul

Title: Re: Scripts for RailClone
Post by: UC3472 on April 01, 2016, 03:57:10 PM
Yes, awesome. Can you post the lap siding, too?
Title: Re: Scripts for RailClone
Post by: UC3472 on April 01, 2016, 04:05:08 PM
Can you share the lap siding model that was used in the script?
Title: Re: Scripts for RailClone
Post by: Paul Roberts on April 01, 2016, 07:05:19 PM
Hi!

I can't find that particular file right now but here's a different one. Actually this one is more flexible with a few more controls and works with Clipping areas or if you prefer you can use an X Spline for the path and a parameter for the height instead.

I hope that helps.

Cheers!

Paul
Title: Re: Scripts for RailClone
Post by: raistlin on April 04, 2016, 12:24:01 PM
Many thanks for all that cool stuff, the roof one is a must and should be a nightmare for A-Tiles tools owner like-me :s.

Now, there is just the need to have a picker tool to be perfect :D.


If i have a request, it's maybe a global panel wich grabb all railclone objects too manage them in one panel.

Title: Re: Scripts for RailClone
Post by: Rokas on April 04, 2016, 02:16:45 PM
If i have a request, it's maybe a global panel wich grabb all railclone objects too manage them in one panel.

What do you mean by "manage" ?

I currently use near done script for managing RC objecs. I could add features You want for a public release:
(http://i.imgur.com/Gv46bUt.png)
Title: Re: Scripts for RailClone
Post by: Paul Roberts on April 04, 2016, 02:57:53 PM
Nice looking script Rokas! We actually have a RailClone lister in the current beta

You can read more about it here: http://docs.itoosoft.com/display/RAILCLONE/RailClone+Lister

(http://docs.itoosoft.com/download/attachments/20938766/image2016-4-1%2011%3A22%3A24.png?version=1&modificationDate=1459525486000&api=v2)

The final release is due in the next few days.

Thanks!

Paul
Title: Re: Scripts for RailClone slicer question
Post by: TL1895 on July 08, 2016, 04:27:00 PM
I am stuck making a style of double hung windows.
I get to the slicing of the default row.  It seems this type of window may need a second segment "default row"
because the upper and lower sashes are in different planes...please see image.
Thanks a lot,
TL1895
Title: Re: Scripts for RailClone
Post by: Paul Roberts on July 08, 2016, 04:37:35 PM
You're right, In this case you'd need different segments for each side of the window. There will inevitably be some slicing operations that the script can't handle, especially for more complex styles, In which case I'd probably duplicate the window and slice the two versions using different settings to get all the segments that you need. That said, I wonder in this case if it might be better to create the frame and the sashes separately? That way you would also have the potential to open and close them if you like. To do this you'd probably need two additional generators, so you'd end up with one for each sash, and one for the frame.

Cheers,

Paul
Title: Re: Scripts for RailClone
Post by: TL1895 on July 08, 2016, 04:46:37 PM
Hi Paul, that was fast!  Opening is not a priority as we do stills 99.9%
I'm going to try just using no x-evenly row, and make the default row include upper and lower sashes.
I'll update in a few...
Thanks
Title: Re: Scripts for RailClone
Post by: Paul Roberts on July 08, 2016, 04:53:46 PM
No problem at all.

I forgot to mention there's a thread here about windows in response to the tutorial that has some other questions and sample files for more complex setups. Some of them might be useful for your needs.

http://forum.itoosoft.com/index.php?topic=3320.0

Many thanks!

Paul
Title: Re: Scripts for RailClone
Post by: TL1895 on July 08, 2016, 05:38:13 PM
I've been reading those, and had previously made a good style, but cannot make this double hung work :(
Well, I've been at it an hour and that's the limit I have ATM.  I emailed a file to support, in case you have a chance to look?

Thanks again,
TL1895
Title: Re: Scripts for RailClone
Post by: Paul Roberts on July 08, 2016, 06:18:15 PM
No problem,

I've just sent you an amended file so you can see how I tackled this and the segments needed. It's basically a modified version of the file shown in the tutorial but with segments added to the sequence operators so that the geometry above the central Y evenly bar account for the change in sash position. I hope that helps.

(http://i.imgur.com/CrhOUAF.gif)

Cheers!

Paul
Title: Re: Scripts for RailClone
Post by: TL1895 on July 08, 2016, 07:05:00 PM
Hi Paul,

I know I've said it before, but that's incredible and you're so helpful!
I'm back in the file later this afternoon, but will check it out first :)

Thanks again,
TL1895
Title: Re: Scripts for RailClone
Post by: QM3423 on July 11, 2016, 02:06:59 PM
Can you please post this file for others to learn from and use?

No problem,

I've just sent you an amended file so you can see how I tackled this and the segments needed. It's basically a modified version of the file shown in the tutorial but with segments added to the sequence operators so that the geometry above the central Y evenly bar account for the change in sash position. I hope that helps.

(http://i.imgur.com/CrhOUAF.gif)

Cheers!

Paul
Title: Re: Scripts for RailClone
Post by: antmarch on August 16, 2016, 12:12:21 PM
for some reason the reverse spline script doesn't work anymore.  I have it as a button on my menu. 
I click the reverse spline only, and it messes up the ID's, never used to do this.  Happens on very simple splines even with only 2 id's.
Title: Re: Scripts for RailClone
Post by: Paul Roberts on August 16, 2016, 12:27:23 PM
Hi,

That's odd. Are you using a different version of Max?

Thanks,

Paul
Title: Re: Scripts for RailClone
Post by: KD2696 on August 23, 2016, 11:55:49 AM
Hi,
Is it possible to make the script, when multiple face are selected, to name the created Roofspline like Roofspline_001, Roofspline_002, ...etc ... and, when created if Roospline_x exists, create Roofspline_x+1
Thx.
Title: Re: Scripts for RailClone
Post by: Michal Karmazín on November 21, 2016, 03:38:46 PM
rcRandomSeed

(http://i.imgur.com/CZaznBV.jpg)

This script will automatically change the Random Seed value for selected RC object(s). Select desired object(s) or use the Select All RC Objects button to pick all RC objects in your scene. Than by clicking the reSeed button, it'll randomly assign new "Random Seed" values to those RC objects.
Title: Re: Scripts for RailClone
Post by: o_wal on January 30, 2017, 10:26:40 AM
Hi there!
Is it possible to make the script which will select base spline of RailClone object?
I think it will be useful for all RC users.
Thank you in advance
Title: Re: Scripts for RailClone
Post by: Michal Karmazín on January 30, 2017, 10:49:52 AM
Hi,

You can easily select any spline / surface used via 3ds max's quad menu (right click) - Select RailClone Base Object. Hope that helps.

Best regards,
Title: Re: Scripts for RailClone
Post by: o_wal on January 30, 2017, 11:03:08 AM
It, great! Thanks
Title: Re: Scripts for RailClone
Post by: Alex.S on March 22, 2017, 10:37:10 AM
If anyone needs a script to bulk disable use instancing engine to selected objects (sure it can be done better, i usually just evaluate all for script editor)...

Code: [Select]
sel = selection as array
count = 1

undo on "Disable Instancing Engine"
(
if sel.count > 0 then
(
while count <= sel.count do
(
obj = sel[count]
count += 1

obj.rendermode = off
)
)
)
Title: Re: Scripts for RailClone
Post by: MF1030 on August 10, 2017, 10:40:25 PM
Hello

I have difficulties with the apply RC to poly script and railclone 3

It happens especially when I have a hole in a surface, like a wall with a window.

The spline generated often appears to be invalid and the same as when I select the face, Ctrl click the edges and then create shape from selection.
Instead of creating two independent rectangles it makes a diagonal that connect the rectangles like on this video https://youtu.be/5w5s3hbfrVc?t=139 (https://youtu.be/5w5s3hbfrVc?t=139).

If I clean up the diagonal, it will work but I have the inside not hollow (like https://forum.itoosoft.com/index.php?topic=4585.0 (https://forum.itoosoft.com/index.php?topic=4585.0) ), the solution I found is to put the first vertice on the bottom left corner, and ask RC to realign

I am not super happy with my solution as it is a bit tedious and quite a few manual steps.

Do you have any advice or suggestions ?

Thank you
Title: Re: Scripts for RailClone
Post by: Paul Roberts on August 11, 2017, 11:38:53 AM
Hi,

RailClone 3 includes new features that should mean that you no longer need to use the script. In RailClone 3 a single RailClone object can populate multiple splines and automatically align them. For these sorts of uses  you may need to change your Auto Align mode (in the generator's clipping properties) to X-XY, and for complex shapes with apertures you can change the hierarchy checking mode to By Material ID and then assign material IDs to the splines to tell RailClone which ones belong to a single face. You can read more about these different modes in our documentation here: https://docs.itoosoft.com/railclone/style-editor/2d-arrays-generator-a2s#id-2Darrays-GeneratorA2S-clippingClippingArea

I hope that helps,

Paul
Title: Re: Scripts for RailClone
Post by: MF1030 on August 11, 2017, 06:45:17 PM
Hello Paul

Thank you for your answer, indeed it helps a lot as it saves the duplication for each spline + alignment of the Railclone object.

I have still an issue concerning the spline creation. If I use the script or Ctrl+edge I have spline as the one attached.

When I run this in railclone it does not see the hole and cover the whole surface.

Do you have a not too manual solution to fix this kind of issues ?

Thank you
Title: Re: Scripts for RailClone
Post by: FC1888 on September 24, 2017, 08:31:31 PM
If I read it right, you have converted the edges of a polygon, with a hole, to crate a spline, for RC, however you would need to remove the diagonal spline which is causing the error. Basically it will be a single spline but have two disconnected parts, the outer one and the inner one, having a spline connecting the outer and inner, means RC sees only the one spline and fills the areas. Hope that cures your problem.
Title: Re: Scripts for RailClone
Post by: yanosh HRDY on January 05, 2018, 11:08:16 AM
Hello,
Can anyone tell me where to find this plugin that is mentioned in this tutorial? thanks in advance.
https://www.youtube.com/watch?v=XhZE0ui55lI
at 14:40 min
named : RC_CreateBoundarySplines

(see attached screenshot)

thank you!!
yanosh
Title: Re: Scripts for RailClone
Post by: Paul Roberts on January 05, 2018, 11:30:46 AM
Hi Yanosh,

That script is available in the downloads for the tutorial. You can find the link in the top-right corner of this page: https://www.itoosoft.com/tutorials/creating-roofs-with-railclone

I hope that helps, please let me know if you have any further questions.

All the best,

Paul
Title: Re: Scripts for RailClone
Post by: yanosh HRDY on January 05, 2018, 12:28:40 PM
perfect!!
thank you Paul...
I actually have a lot of questions that come to me about Rail clone, not necessarily about the plug in ... I'll sort, condense all that and ask questions in the section dedicated ... ;)
Title: Re: Scripts for RailClone
Post by: arch3d on February 19, 2019, 03:27:03 AM
http://www.splinedynamics.com/product/subspline/

This script is a must. And now its 50% off
Title: Re: Scripts for RailClone
Post by: Dragan on February 19, 2019, 11:26:58 PM
Thank you.
Just purchased. I found it very useful.
Need some improvements but overall it is a great tool.

Dragan
Title: Re: Scripts for RailClone
Post by: raistlin on May 19, 2019, 07:37:22 PM
Is there a script to select all RC splines and clipping splines? Or select each splines dependance from a selction of railclones objects?
Title: Re: Scripts for RailClone
Post by: Rokas on May 20, 2019, 09:46:53 AM
Is there a script to select all RC splines and clipping splines? Or select each splines dependance from a selction of railclones objects?

Hi. Here You are.
It has no User Interface but You can place it as a button in max UI Yourself. Let me know if You need anything else.
Title: Re: Scripts for RailClone
Post by: raistlin on May 20, 2019, 09:31:18 PM
Is there a script to select all RC splines and clipping splines? Or select each splines dependance from a selction of railclones objects?

Hi. Here You are.
It has no User Interface but You can place it as a button in max UI Yourself. Let me know if You need anything else.

Many thanks !!