Itoo Software Forum

Author Topic: Scripts for RailClone  (Read 8477 times)

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Scripts for RailClone
« 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.
« Last Edit: May 08, 2015, 04:25:30 PM by Paul Roberts »
Paul Roberts
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #1 on: May 08, 2015, 03:24:07 PM »
Reverse Spline



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:
  • Select an editable spline
  • Switch to the spline sub-object level
  • Select 1 or more splines
  • Click a reverse option



I hope you find it useful.

Many thanks,

Paul
« Last Edit: May 08, 2015, 03:26:41 PM by Paul Roberts »
Paul Roberts
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #2 on: May 08, 2015, 04:02:24 PM »
RailClone Slicer



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:
  • Run the script and then pick the object from the scene.
  • Activate the checkboxes to turn on the segments you wish to create and adjust the slice points using the position parameters. If you're using an L1S generator you only need to use the settings in the L1S/Columns group. If you're using an A2S generator you'll need at least one option checked in each of the Columns and Rows groups. It's not possible to use the Rows group on its own.
  • To get an idea of what is being slice, you'll need edged faces on, as it only shows one slice plane at the top of the modifier stack. (I had an idea about temporarily adding spline rectangles to mark the slices, but I haven't got around to it yet)
  • When your cuts are in the right places, press Slice Geometry to create the segments
  • Finally, if you'd like to remove the Slice modifiers from the original geometry, press the C button.



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.



You can read more about this here.

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

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
« Last Edit: November 18, 2015, 05:57:01 PM by Paul Roberts »
Paul Roberts
iToo Software

KN1988

  • Newbie
  • *
  • Posts: 22
Re: Scripts for RailClone
« Reply #3 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.
« Last Edit: May 17, 2015, 10:16:56 AM by KN1988 »

Shawn Olson

  • Jr. Member
  • **
  • Posts: 67
  • Wall Worm
    • Wall Worm
Re: Scripts for RailClone
« Reply #4 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 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.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #5 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.

Paul Roberts
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #6 on: August 25, 2015, 10:12:19 PM »
For an explanation of when this might be useful, see this thread.

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


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
Paul Roberts
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #7 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:



To use:

  • Select a spline
  • Click Pick Library
  • Select the style from the library and import
  • Click Apply to Spline

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
Paul Roberts
iToo Software

RobH2

  • Newbie
  • *
  • Posts: 27
  • Who is staring at the sea is already sailing.
    • NVision4D
Re: Scripts for RailClone
« Reply #8 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.

3ds Max Design (3D Studio thru Max 2018), ForestPack Pro 5.4.0, RailClone 3.0.7, ASUS P9X79 Motherboard, Intel i7-3960x, Hydro H80 CPU Chiller, 64GB DDR3 Ram, Quadro K5200 Display Adapter

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #9 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:

  • The surface must be an Editable Poly object with no modifiers applied.
  • The RailClone objects should have a clipping spline applied with the Generator set to Get X/Y Size from Area. The Clipping spline needs to be the first entry in the Base Objects rollout. If necessary you can use the arrows change the order.

  • Run the Script and use the Pick Rc Object button to select the RailClone object you'd like to clone.
  • Select the polygons on the surface and click apply RC to Faces. The script will create a new clipping spline and RailClone object for each polygon
  • Alternatively hold shift and click RC to Faces and the script creates a single spline and RC object that combines the selected faces. This is most useful when all the faces selected are planar.


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

Many thanks!

Paul
« Last Edit: January 14, 2016, 11:25:23 AM by Paul Roberts »
Paul Roberts
iToo Software

Macker

  • Jr. Member
  • **
  • Posts: 87
Re: Scripts for RailClone
« Reply #10 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!

antmarch

  • Newbie
  • *
  • Posts: 34
    • portfolio
Re: Scripts for RailClone
« Reply #11 on: January 29, 2016, 05:11:38 PM »
Apply to poly script  is a timesaver indeed!

 Thanks very much for these guys!

Macker

  • Jr. Member
  • **
  • Posts: 87
Re: Scripts for RailClone
« Reply #12 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.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1517
Re: Scripts for RailClone
« Reply #13 on: March 03, 2016, 11:27:58 PM »
Could you upload your roof surface?  I'll check it out.

 Thanks !

Paul
Paul Roberts
iToo Software

Macker

  • Jr. Member
  • **
  • Posts: 87
Re: Scripts for RailClone
« Reply #14 on: March 04, 2016, 10:04:15 AM »
Sure, here it is. Maybe I've just built the style wrong?