Message 1 of 4
scripted PFlow creation taking a long time...
Not applicable
07-09-2009
10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I am working on a script to make a fairly complicated PFlow. I've encountered a problem where each time the script appends another test and then wires it to a new event, the time to process the script increases dramatically. Here's a sample piece of code with the output below:
MaxScript:
Listener Output:
As you can see, the append and wire phases take nearly double the about of time as the previous iteration. This script only has 5 loops, whereas my full script will do this a few hundred times. Either I am going about this the wrong way, or something is really busted. Any ideas? At the current state of my script, it will probably take a few days to build the entire particle system that I am planning.
Thanks,
Ray
MaxScript:
particleFlow.BeginEdit()
evB = Event name:("Event_B")
evB_opScriptOp = Script_Operator Proceed_Script:("on ChannelsUsed pCont do ( pCont.useFloat = true; ) on Init pCont do () on Proceed pCont do ( count = pCont.NumParticles() for i in 1 to count do ( pCont.particleIndex = i; pCont.particleFloat = random 0.0 10.0; ) ) on Release pCont do ()")
particleFlow.EndEdit()
evB.AppendAction evB_opScriptOp
for i = 1 to 5 do (
t1 = timestamp()
particleFlow.BeginEdit()
evC = Event name:("Event_C_"+ i as string)
t2 = timestamp()
evB_opScriptTest = Script_Test Proceed_Script:("on ChannelsUsed pCont do ( pCont.useFloat = true; ) on Init pCont do () on Proceed pCont do ( count = pCont.NumParticles() for i in 1 to count do ( pCont.particleIndex = i; if pCont.particleFloat <= "+ i as string +" do ( pCont.particleTestStatus = true; ) ) ) on Release pCont do ()")
t3 = timestamp()
particleFlow.EndEdit()
t4 = timestamp()
evB.AppendAction evB_opScriptTest
t5 = timestamp()
evB_opScriptTest.setNextActionList evC evB_opScriptTest
print ("Setup time:"+ (t2 - t1) as string +" Create Script_Test:"+ (t3 - t2) as string +" End edit:"+ (t4 - t3) as string +" Append:"+ (t5 - t4) as string +" Wire:"+ (timestamp() - t5) as string +" Total:"+ (timestamp() - t1) as string)
)
Listener Output:
OK
$Event:Event_B @
MouseTool:ScriptAction8A887020
$Script_Operator:Script Operator 01 @
OK
true
MouseTool:ScriptAction49389BB0
"Setup time:1 Create Script_Test:3 End edit:0 Append:87 Wire:155 Total:246"
MouseTool:ScriptAction49389870
"Setup time:1 Create Script_Test:4 End edit:0 Append:195 Wire:277 Total:477"
MouseTool:ScriptAction49389530
"Setup time:1 Create Script_Test:3 End edit:0 Append:339 Wire:451 Total:794"
MouseTool:ScriptAction493891F0
"Setup time:1 Create Script_Test:3 End edit:0 Append:536 Wire:677 Total:1217"
MouseTool:ScriptAction49388EB0
"Setup time:1 Create Script_Test:4 End edit:0 Append:815 Wire:1005 Total:1825"
OK
As you can see, the append and wire phases take nearly double the about of time as the previous iteration. This script only has 5 loops, whereas my full script will do this a few hundred times. Either I am going about this the wrong way, or something is really busted. Any ideas? At the current state of my script, it will probably take a few days to build the entire particle system that I am planning.
Thanks,
Ray