Itoo Software Forum

Author Topic: Multiple same style RC, different splines = BIG filesize  (Read 1618 times)

Rokas

  • Sr. Member
  • ****
  • Posts: 424
Multiple same style RC, different splines = BIG filesize
« 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?

Rokas

  • Sr. Member
  • ****
  • Posts: 424
Re: Multiple same style RC, different splines = BIG filesize
« Reply #1 on: July 01, 2014, 12:50:03 PM »
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?

« Last Edit: July 01, 2014, 01:19:19 PM by Rokas »

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Multiple same style RC, different splines = BIG filesize
« Reply #2 on: July 01, 2014, 03:54:00 PM »
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.
Carlos Quintero
iToo Software

Rokas

  • Sr. Member
  • ****
  • Posts: 424
Re: Multiple same style RC, different splines = BIG filesize
« Reply #3 on: July 01, 2014, 04:15:34 PM »
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


iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Multiple same style RC, different splines = BIG filesize
« Reply #4 on: July 01, 2014, 04:48:05 PM »
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).
Carlos Quintero
iToo Software

Rokas

  • Sr. Member
  • ****
  • Posts: 424
Re: Multiple same style RC, different splines = BIG filesize
« Reply #5 on: July 01, 2014, 05:04:51 PM »
Thank You. I will update this thread after looking into this later on.

Rokas

  • Sr. Member
  • ****
  • Posts: 424
Re: Multiple same style RC, different splines = BIG filesize
« Reply #6 on: July 20, 2014, 08:27:45 AM »
sobjref is read only, how can I modify it?

error i get:
-- Runtime error: Attempt to set read-only property: sobjref

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Multiple same style RC, different splines = BIG filesize
« Reply #7 on: July 20, 2014, 09:01:43 AM »
Ops!, you are right. I forgot this parameter is not writable. :(
Unfortunately the workaround cannot be used.
Carlos Quintero
iToo Software

Rokas

  • Sr. Member
  • ****
  • Posts: 424
Re: Multiple same style RC, different splines = BIG filesize
« Reply #8 on: July 20, 2014, 08:15:40 PM »
Can I maxscript "Copy Style to Multiple" operation?

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3156
    • iToo Software
Re: Multiple same style RC, different splines = BIG filesize
« Reply #9 on: July 21, 2014, 09:00:40 AM »
No, sorry. That operation is not exposed to Maxscript.
Carlos Quintero
iToo Software