Itoo Software Forum

Author Topic: Master Style - Update RailClone Style - Maxscript  (Read 473 times)

p.hubert

  • Newbie
  • *
  • Posts: 2
Master Style - Update RailClone Style - Maxscript
« on: April 07, 2023, 10:24:34 AM »
Hello everyone,

I am currently working on an automated layout script for my company. We would like to be able to switch decorations after setting up an apartment. So, we have created several custom RailClone styles for each room and decoration.

However, I am having trouble automating the decoration switch with RailClone and MaxScript.

Initially, I thought about directly switching the style with a MaxScript command. But I saw on a forum post that this was not possible due to a limitation in Max. So, I gave up on this idea but wanted to make sure that nothing has changed in this regard.

https://forum.itoosoft.com/railclone-pro-(*)/railclone-and-maxscript-usage/

I then turned to master styles. I thought that since I already had my RailClone loaded into my scene as a reference RailClone, it would be easier to create empty RailClone objects through MaxScript and then use the $.stylelink command to link the child RailClones to the reference style. Then, I would only need to change the style on the reference RailClone to switch all the others.

But when I try to automate this through MaxScript, I can see the reference RailClone in the location of the master style. However, the rest of the parameters do not load. I am forced to manually click the update button next to the master style for everything to load correctly.

Is there a way to update the child RailClones through MaxScript, or is this still something impossible due to Max?

If this button responds to a function that I can call, it would solve all my problems. And if that's not the case, if you have a possible solution, I am interested, knowing that I will have many RailClones to update and doing it manually is not a viable solution.

Thank you in advance,

Pierre



iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4396
    • iToo Software
Re: Master Style - Update RailClone Style - Maxscript
« Reply #1 on: April 10, 2023, 09:56:43 AM »
Hello Pierre,

I'm afraid it's not possible to set Style Linking by Maxscript.

This process involves several steps, not only setting $.stylelink. It copies Style description, all parameters and references from the RC source.
The 'stylelink' parameter is used only as reference to the parent, but the updating process is pretty complex.

What about if you create a copy of the master RC object, and assign the parameters by Maxscript ?
Since you handle everything by Maxscript, it should not be a problem to delete/create new objects, when you need to assign a new style.

Carlos Quintero
iToo Software