Hi Matt,
 
That makes a whole lot of sense. What confuses me is that if a script simply 
brute forces a copy/paste of each partition (with overrides) it doesn't suffer 
this post-save pass-switch lag (but takes 6x as long to run). However, if it 
rebuilds every pass, partition, displayprop etc from scratch but copy/pastes 
only the overrides to each partition it does suffer this odd post-save 
pass-switch lag. Fundamentally the passes are the same  - it's just how they 
have been built that seems to create this problem.
 
I have been looking into rebuilding the overrides from scratch which I assume 
will eliminate this problem and keep the super fast running times. But stumbled 
into a problem with determining the type of override and keeping it flexible. 
I've tried using a wildcard to fill in the gaps.....
 
 
 
newOverride = xsi.SIAddProp ("Override", newPartition[0])
print "NEW OVERRIDE = " + str(newOverride[0])
     for eachParam in eachProp.parameters:
      paramValue = eachParam.Value
      if eachParam.name != "Name":
       eachParamSplit = str(eachParam).split (".")
       eachParamSplit = eachParamSplit[-1:]
       eachParamSplit = str(eachParamSplit)[2:-2]

       member = eachPartition.members[0]
       tempName = str(member) + ".*." + eachParamSplit
       xsi.SIAddEntryToOverride(newOverride[0], str(tempName))
 
Using this wildcard creates the new override entries on the source partition 
override not the newly created one. But this is another problem altogether.....
 
Apologies for the poor formatting (our webmail's a bit rubbish!)
 
G 

________________________________

From: [email protected] on behalf of Matt Lind
Sent: Wed 03/04/2013 19:22
To: [email protected]
Subject: RE: Application.CopyPaste



Any time you use CopyPaste() (or any other command for that matter), you're 
going to trigger events which incur additional processing cost.  CopyPaste() 
usually invokes validation routines before Softimage returns control to the 
user as it needs to ensure no illegal scenarios have been created.  Whether 
validation is invoked really depends on what you're copying and pasting.  If 
you use Partition.AddProperty() in the scripting object model, you'll avoid 
some of the performance hit.

 

A parameter override is just a variant of a custom property.  The performance 
hit comes from evaluating the contents of an override property as changing 
passes or updating a partition means Softimage has to extract the parameters 
from the override property and determine if they exist on each and every 
object, cluster, and shader in the partition to build a map so it knows what to 
draw onscreen in the viewport as a final result.  If the scene is large (e.g. 
many objects or many parameters), then it will take a while to build the map.  
When you leave the pass, the internal map is destroyed and replaced with a new 
map for the pass you are entering.

 

If you want better performance, use material/shader overrides instead of 
parameter overrides.  i.e. apply shaders/materials to the partition instead of 
override properties.  These tend to evaluate significantly faster because 
Softimage can make wide assumptions and do less work to reach a final result.  
Example: a material override means all objects in the partition use the same 
materials and shaders.  With a parameter override, Softimage must drill down 
and compare each and every object, cluster, and shader for overridden 
parameters.

 

 

Matt 

 

 

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of Gareth Bell
Sent: Wednesday, April 03, 2013 2:18 AM
To: [email protected]
Subject: Application.CopyPaste

 

Morning all,

 

Just a quick shout out to see if anyone has come across this before. I'm sort 
of re-hashing a previous thread I started some time ago but this time I rewrote 
the whole script in Python.

 

To give you a little context we work on enormous scenes (1gb+) with hundreds of 
passes/partitions. We've found that Ctrl+D a pass takes too long and there's no 
progress display so have resorted to writing our own Duplicate Pass script.

 

What it does is essentially rebuilds the selected passes from scratch. It all 
works fantastically well except after saving the scene, changing passes takes 
anywhere north of 20mins. After a little routing around in the code I;ve 
deduced it is only the copy/paste of partition overrides that causes this. All 
other aspects of the rebuild are made from scratch i.e. newPartition = 
xsi.SICreatePartition (newPass[0], eachPartition.name, partitionMembers), 
newDisplayProp = xsi.AddProp ("Display Property", newPartition[0]) etc. But the 
only way (well the easiest way!) I could get a solid remake of the partition 
override is through xsi.CopyPaste (eachOverride, "", newPartition[0]). This 
copy/paste seems to be the reason passes are taking so long to change.

 

Would anyone have an inkling as to why this command is causing the whole scene 
to slow down so much post-save?

 

XP Soft 2012 SP1

 

Cheers

 

G

<<winmail.dat>>

Reply via email to