Scripted Melt Attempt
Scripted Melt Attempt
Hey Guys ... so I am jumping on the scripted melt bandwagon ... I am must be having a brain freeze because my script seems to release a bunch of particles in the first few frames and then stops ... so the internal particles of the point cloud are remaining un-melted.
Last edited by mdonovan on Tue Jun 29, 2010 9:28 pm, edited 1 time in total.
-
- Posts: 71
- Joined: Wed Jun 09, 2010 6:23 pm
Re: Scripted Melt Attempt
Hi!
Would you mind to write the script in code format? I mean in this way "".
So we could test it better.
And example:
Cheers!
Would you mind to write the script in code format? I mean in this way "
Code: Select all
script
So we could test it better.
And example:
Code: Select all
test_radius = .05
neighbors_below_threshold = False
#--------------------------------------------------
# Function: onSimulationBegin
#--------------------------------------------------
def onSimulationBegin():
shape_emitter = scene.getEmitter("fill")
particle = shape_emitter.getFirstParticle()
while (particle):
particle.freeze()
particle = particle.getNextParticle()
blank = " \n"
scene.message(str(blank*300))
Jorge Medina Alix
VFX TD / 3DFluids Consultancy
Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy
VFX TD / 3DFluids Consultancy
Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy
Re: Scripted Melt Attempt
Thanks for the reply ... here is where I am at...
http://www.shimmerstudios.com/Public/melt_v1b.mov
There are a few things that I still need to figure out ...
1) i am adjusting the search radius in the getneighbors() call by using the y value of an animated null. At some point there is a critical value at which the number of particles released is too large resulting in a particle "dump". I would be curious is there is a way to avoid this through code rather than tweaking the null animation.
2) some particles get left behind for some reason .. if anyone has thoughts on this ... thanks.
3) It would be cool if I could drop larger particles masses that get disconnect from the main body ... in order to avoid the hanging in mid air look.
Any thoughts are appreciated
Michael
ps here is the code ...
http://www.shimmerstudios.com/Public/melt_v1b.mov
There are a few things that I still need to figure out ...
1) i am adjusting the search radius in the getneighbors() call by using the y value of an animated null. At some point there is a critical value at which the number of particles released is too large resulting in a particle "dump". I would be curious is there is a way to avoid this through code rather than tweaking the null animation.
2) some particles get left behind for some reason .. if anyone has thoughts on this ... thanks.
3) It would be cool if I could drop larger particles masses that get disconnect from the main body ... in order to avoid the hanging in mid air look.
Any thoughts are appreciated
Michael
ps here is the code ...
Code: Select all
threshold = 5.5
#--------------------------------------------------
# Function: onSimulationBegin
#--------------------------------------------------
def onSimulationBegin():
shape_emitter = scene.getEmitter("fill")
particle = shape_emitter.getFirstParticle()
while (particle):
particle.freeze()
particle = particle.getNextParticle()
blank = " \n"
scene.message(str(blank*200))
#--------------------------------------------------
# Function: onSimulationStep
#--------------------------------------------------
def onSimulationStep():
global threshold
ctrl_null = scene.getObject("Null01")
shape_emitter = scene.getEmitter("fill")
melted=scene.getEmitter("melted")
null_pos = ctrl_null.getParameter("Position")
test_radius = ( null_pos.getY() * .07)
particles =shape_emitter.getParticles()
for particle in particles:
neighbors = particle.getNeighbors(test_radius)
no_neighbors = len(neighbors)
pid = particle.getId()
pos=particle.getPosition()
vel=particle.getVelocity()
#scene.message( str(threshold))
if (no_neighbors < threshold):
melted.addParticle(pos,vel)
shape_emitter.removeParticle(pid)
Re: Scripted Melt Attempt
Here is my latest version
Melt V2
Still suffering from icebergs being released rather than a nice steady melt. I think this is because a lot of my particles might be the same distance from each other. I have to think about this ... any help would be great.
Also ... I need to figure out how to make particle clumps that get detached from the main body melt immediately. This should also help me solve the stranded particle problem.
Anyway ... its where I am at.
Melt V2
Still suffering from icebergs being released rather than a nice steady melt. I think this is because a lot of my particles might be the same distance from each other. I have to think about this ... any help would be great.
Also ... I need to figure out how to make particle clumps that get detached from the main body melt immediately. This should also help me solve the stranded particle problem.
Anyway ... its where I am at.
-
- Posts: 71
- Joined: Wed Jun 09, 2010 6:23 pm
Re: Scripted Melt Attempt
I hadn´t have time to test it right now, but in a first look seems to be a problem in the line and the statement
I think you should use fixed values in the neighbours.
I did something similar using a Filter daemon.
Code: Select all
test_radius = ( null_pos.getY() * .07)
Code: Select all
if (no_neighbors < threshold):
I did something similar using a Filter daemon.
Jorge Medina Alix
VFX TD / 3DFluids Consultancy
Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy
VFX TD / 3DFluids Consultancy
Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy
Re: Scripted Melt Attempt
I am not sure I understand what you are getting at =/. I am slowly decreasing my search radius using an animated null .. the reason I am doing this is so as the particles melt my test for fewer neighbors gets slowly smaller. I found that unless I reduce my radius in the getneighbors call the particles will stop melting at all after a bit.
does that make sense ??
does that make sense ??
-
- Posts: 71
- Joined: Wed Jun 09, 2010 6:23 pm
Re: Scripted Melt Attempt
Yes, that make sense. I´ve seen in other posts you are nearly to solve it, aren´t you?
Jorge Medina Alix
VFX TD / 3DFluids Consultancy
Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy
VFX TD / 3DFluids Consultancy
Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy