Itoo Software Forum
RailClone => RailClone Pro (*) => Topic started by: Rokas on July 01, 2014, 12:18:58 PM
-
Hi, i got a problem.
What is the way to prepare a style to be copied on multiple shapes ?
Now my prepared style takes 20MB- that's fine, but when i copy style to multiple shapes, my scene becomes huge (~1.1 GB) (I have ~150 of shapes for one style)
I don`t mind that the references are huge(although it would be nice if RC were optimized in this area too), but how can I put all those references outside my scene file, to maintain manageable filesize?
-
ok, seems like RC objects can be xrefed like regular objects- that`s unexpected but really great news..
update:
no, not really.. saved scene won`t be loaded with xrefed RC...
what else can be done?
-
RailClone holds the references to segments in two ways:
1) Directly to the source object if it exists in the scene. In this case, you can see the name of the object in the segment node (in the style editor)
2) If the source object is deleted or the style is imported from the library, the geometry is stored internally. The name of the object is shown as "--embedded--" in the segment's properties.
But in both cases, RailClone tries to share these references when possible, to not duplicate geometries. For example, when a style is assigned from the Library to multiple objects, or when using any of the "Copy Style" procedures.
So, this problem is strange, because theorically all your objects should share the same references. I've done a quick test here, and everything works as intended.
Please, run this Maxscript command and tell us the result. You must replace "RailClone001" and "RailClone002" with the name of two RC objects:
$RailClone001.sobjref[1] == $RailClone002.sobjref[1]
It will return "true" if both share the same reference (for the first segment), and false if not.
-
RailClone holds the references to segments in two ways:
1) Directly to the source object if it exists in the scene. In this case, you can see the name of the object in the segment node (in the style editor)
2) If the source object is deleted or the style is imported from the library, the geometry is stored internally. The name of the object is shown as "--embedded--" in the segment's properties.
But in both cases, RailClone tries to share these references when possible, to not duplicate geometries. For example, when a style is assigned from the Library to multiple objects, or when using any of the "Copy Style" procedures.
So, this problem is strange, because theorically all your objects should share the same references. I've done a quick test here, and everything works as intended.
Please, run this Maxscript command and tell us the result. You must replace "RailClone001" and "RailClone002" with the name of two RC objects:
$RailClone001.sobjref[1] == $RailClone002.sobjref[1]
It will return "true" if both share the same reference (for the first segment), and false if not.
It`s false.
I`m postitive the issue is due to my bad maxscript when i do copying of RC to shapes.
Copying style to all those RC objects did the trick- scene is considerably lighter- 67 MB instead of 1.1GB,
But scripting is unavoidable so I would like to make that efficieant.
I use this command:
maxOps.cloneNodes MainRC cloneType:#copy newNodes:&nnl
-
Strange... i made a quick test using "cloneNodes" and it doesn't duplicate the references. Same for Ctrl+V.
In any case, there is a workaround that would work for you: RailClone stores the segment references in "sobjref" (an array, one item by segment). So a Maxscript that copies these references between RC objects should "optimize" them, removing the duplicated geometries (not tried that though).
-
Thank You. I will update this thread after looking into this later on.
-
sobjref is read only, how can I modify it?
error i get:
-- Runtime error: Attempt to set read-only property: sobjref
-
Ops!, you are right. I forgot this parameter is not writable. :(
Unfortunately the workaround cannot be used.
-
Can I maxscript "Copy Style to Multiple" operation?
-
No, sorry. That operation is not exposed to Maxscript.