having issues resuming

Hi

I am having issues resuming a simulation even though I am not changing any settings in between. Funny thing is in the begining when i was 6 frames into the simlation it was allowing me but once I reached the halfway point its not letting me resume. Anyone experience this?

Thanks

Hi. Is this a particle reflow simulation or a field simulation?

its a kind of reflow. using a fume as velocity field but emitting from animated geo.

But we are talking about the Stoke Particle Simulator. The Stoke Field Simulator has the same resume feature, so we needed to make sure we are talking about the same object…

Can you clarify what “its not letting me resume” means?
Is that that you press the Resume button and nothing happens?
Or is the Resume button grayed out? Or not there at all?

The more you type, the easier our debugging task becomes :slight_smile:

I suspect that the RESUME button becomes grayed out for some reason. The most probable reason is that the hash checksum of the relevant values in the object has somehow changed between the two runs. The checksum is built by getting all properties of the simulator, collecting the relevant ones (skipping any properties that do not affect the ability to resume), and collecting a string of all these values, then getting the hash of that string. The Resume button gets grayed out if the hash calculated when the sim started and the current hash are different (which would imply a property value changed somewhere). It also checks if a valid simulator instance was created, if its time is valid, and if the time is less than the end time of the simulation.

So at this point I would concentrate on the hash. You can open the MAXScript Editor, load the file StokeUI.ms from the Stoke installation’s \Scripts folder, and modifying the Hash function like this:

fn getHashSum = ( local thePropString = "" as stringStream for p in getPropNames this where findItem #(#memoryCacheStep,#memoryLimit, #threadLimit, #subSteps, #updateViews, #updateViewsEvery,#rate,#endtime,#viewPercentage,#viewLimitEnabled,#viewLimit,#ViewVectorNormalize,#viewVectorScale,#iconSize,#velocityScales,#VelocityScale) p == 0 do ( format "%\n" (getProperty this p) to:thePropString ) format "%\n" (thePropString as string) (dotNetObject "System.String" thePropString).GetHashCode() )

Press CTRL+E to reevaluate without saving the file, and try running the sim, pausing, and resuming. Each time the UI evaluates the hash checksum, a multi-line string will be printed to the Listener showing the values of all relevant properties.

Note that the list of properties strings will contain all objects used as emitter and velocity source. They are listed as MAXScript values, so their name and base position are included in the string. Thus, if you move an emitter by a fraction of a unit on frame 0, the MAXScript value describing that object will change in the string, and the Resume button will become disabled because the hash will be different. Same applies to changing any channels requested to be saved, the names of the objects used to emit and drive the simulation, etc.

It would be interesting to see the hash printed when you start simulating, and the one printed when the Resume is disabled (assuming that’s what happens in your case).

Hi
I am using the particle simulator and the resume button is greyed out. once I start and stop the simluator. I put the code that you gave me and thats the print out i got. I wonder if its because the object source is an alembic sequence.

[code]–Asynchronous Saving During Simulation Using 6 Threads On 12 Cores.
570134_645543
D:\Projects_clients___________\Sim Caches\Stoke\Trails\test
v003
Stoke_body
true
0
false
0
false
100
1
12
2
true
false
1.0
1
#($Alembic_Object:HorseRig1:Horse_WesternShape @ [-0.666384,-2162.448242,0.000000])
#(true)
#(100)
#("")
#(0.0)
#(false)
#(true)
#(5.65562)
100
0.0
6.85343
12349
true
#(“Velocity”, “ID”, “Age”, “LifeSpan”)
#("")
false
#()
#($FumeFX:FumeFX001 @ [-26.197083,-2643.876221,-6.607834])
#(true)
true
#(10.0)
#(5)
#(true)
2.0
5
true
Object

–Save Channel Map:
–Position float32[3]
–Velocity float16[3]
–ID int64[1]
–Age float16[1]
–LifeSpan float16[1]
570134_645543
D:\Projects_clients\59 Productions\DWC_HorseFX\Sim Caches\Stoke\Trails\test
v003
Stoke_body
true
0
false
0
false
100
1
12
2
true
false
1.0
1
#($Alembic_Object:HorseRig1:Horse_WesternShape @ [-4.820711,-2622.061035,0.000000])
#(true)
#(100)
#("")
#(0.0)
#(false)
#(true)
#(5.65562)
100
0.0
6.85343
12349
true
#(“Velocity”, “ID”, “Age”, “LifeSpan”)
#("")
false
#()
#($FumeFX:FumeFX001 @ [-30.325699,-3103.490479,-6.607834])
#(true)
true
#(10.0)
#(5)
#(true)
2.0
5
true
Object

–Generate Time: 0.499 sec.
–Advect Time: 0.21 sec.
–Magma Step Time: 0.151 sec.
–Advect Time Excluding Per-Step Magma: 0.059 sec.
–Update Time: 4.909 sec.
–Delete Time: 0.004 sec.
–Overhead Time: 0.883 sec.
–TOTAL Stoke Time: 6.505 sec.
–Flushing Cache Using 11 Threads On 12 Cores.
–ASYNC DISK CACHE FINISHED SAVING IN 0.002 SECONDS.
[/code]

$[#Object].SequenceCacheCapacityMB = 8192
$[#Object].SerializeQueueCapacityMB = 0

It looks like the Alembic and the FumeFX Position values are changing between the two hashes.

#($Alembic_Object:HorseRig1:Horse_WesternShape @ [-0.666384,-2162.448242,0.000000]) #($FumeFX:FumeFX001 @ [-26.197083,-2643.876221,-6.607834])
turn into

#($Alembic_Object:HorseRig1:Horse_WesternShape @ [-4.820711,-2622.061035,0.000000]) #($FumeFX:FumeFX001 @ [-30.325699,-3103.490479,-6.607834])
Were you on the same frame when you started simulating and when you tried to resume?
Are their positions keyframed?

Let’s consider this a bug. :blush:

It appears that the position part of the signature is changing over time. I will have to fix this by using the iNode.handle of the source objects instead of their MAXScript values, as the latter seem to change if the time slider is moved to a different frame.

I will try to post a fix ASAP.

Here is the fixed hash function:

	fn getHashSum =
	(
		local thePropString = "" as stringStream
		for p in getPropNames this where findItem #(#memoryCacheStep,#memoryLimit, #threadLimit, #subSteps, #updateViews, #updateViewsEvery,#rate,#endtime,#viewPercentage,#viewLimitEnabled,#viewLimit,#ViewVectorNormalize,#viewVectorScale,#iconSize,#velocityScales,#VelocityScale) p == 0 do
		(
			if findItem #(#distSources, #VelocitySources) p > 0 then
			(
				local theProp = for i in (getProperty this p) collect if isValidNode i then i.inode.handle else -1
				format "%\n" theProp to:thePropString 
			)
			else
				format "%\n" (getProperty this p) to:thePropString 
		)
		(dotNetObject "System.String" thePropString).GetHashCode()
	)

Make sure you have the necessary permissions to modify the StokeUI.ms file in the Program Files subfolder. Replace the function and save the file. This should allow you to resume simulations if source objects are animated and you are on different frames when starting and resuming the simulation.

Thanks Bobo, its working now start and resume on demand!

Probably redundant now but the answers to yours questions

Were you on the same frame when you started simulating and when you tried to resume?

I wasnt on the same frame

Are their positions keyframed?

The emitter is animated geo and the fume grid is also parented to it.