Force SimpleMod Update

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  03 March 2013
Force SimpleMod Update

Any one ever found a good way to force a plugin simpleMod to update? I have found that unless on of the parameters of the modifier is animated the modifier will not update in the scene.

I have a modifier projecting its mesh to the surface of another. The only time that the mesh updates is when the target mesh is being moved interactively moved in the scene. If you animate that mesh and scrub the time line it doesn't update the modifier. If the object the modifier is on is moved or animated it also doesn't update the modifier. If keys are set on any track for the modifier it will up date only between those keys.

I'm just prototyping in Max Script but wanted to release it as a freebee but if it can't do this it really has no point.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
I should note that what is strange is that the gizmo for the modifier always updates correctly. It is only the verts of the mesh that don't.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
notifydependents <modifier> maybe?
 
  03 March 2013
Originally Posted by denisT: notifydependents <modifier> maybe?

the question is where to call it... hmm...
 
  03 March 2013
Just remembered another strange finding. If I force the gizmo of the modifier with something like this.gizmo.transform=matrix3 1 before returning p in the map loop it updates the modifier but only when it is selected and the modifier panel is open.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
you can probably add any of transformable nodes that have to update the modifier to its parameter block as NodeTransformMonitor... it has to force notification and update
 
  03 March 2013
You would think so Denis but that isn't working since I'm already storing the target node as a node and not even a nodeTransformMonitor. This should be forcing the update if the target is animated but it doesn't. I have also tried to store just the transform controller for the target to see if it would work and that to doesn't.

The ugly solution that I just came up with is forcing a script controller onto a dummy track when the modifier is created. That solves all the issues but it ain't pretty.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
Originally Posted by PEN: The ugly solution that I just came up with is forcing a script controller onto a dummy track when the modifier is created. That solves all the issues but it ain't pretty.

yeah... that was my backup idea...
 
  03 March 2013
I should try and look at how these scripted simpleMods have been implemented. They are faster then they used to be but have strange slow downs as well.

Interactively I get 200 FPS but when animated I get 15 FPS. One would assume that it is doing just as much work but it must not. Looks like the update calls are getting spammed when the time line is changing.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
Originally Posted by PEN: I should try and look at how these scripted simpleMods have been implemented. They are faster then they used to be but have strange slow downs as well.

Interactively I get 200 FPS but when animated I get 15 FPS. One would assume that it is doing just as much work but it must not. Looks like the update calls are getting spammed when the time line is changing.

that's true... they much slower than expected, even so, they are written with SDK.
the same story with Skin Modifier... i do the same as skin ~50 times faster than the skin... and i have no idea what skin does do all this time. that's puzzles me.
 
  03 March 2013
Missed something with the script controller to force the update. This updates everything BUT when the object with the modifier is being moved interactively. Very odd. So for that I have added a #maxObject with nodeTransformMonitor with the projecting node being referenced to it.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
Originally Posted by PEN: Missed something with the script controller to force the update. This updates everything BUT when the object with the modifier is being moved interactively. Very odd. So for that I have added a #maxObject with nodeTransformMonitor with the projecting node being referenced to it.

not pretty, but that's max's fault.
 
  03 March 2013
i don't know how fast is it but it doesn't look too ugly:

  plugin simpleMod Buddy
  	name:"Buddy"
  	classID:#(0x15854bf6, 0x72fd7d4a)
  ( 
  	fn getNode = (refs.dependentnodes this)[1]
  	parameters params
  	(
  		node type:#maxobject
  		notifier type:#float
  		target type:#node
  	)
  	rollout params "Parameters"
  	(
  	)
  	local tm
  	on map i p do if isvalidnode target and node != undefined do
  	(
  		if i == 1 do
  		(
  			front = normalize (target.pos - node.node.pos)
  			side = normalize (cross front [0,0,1])
  			up = cross front side
  			tm = matrix3 front side up [0,0,0]
  		)
  		p *= tm
  	)
  	fn addNotification source: = 
  	(
  		if source == unsupplied do source = getNode()
  		node = NodeTransformMonitor node:source
  		notifier.controller = float_script script:"notifydependents this; 0"
  	)
  	on attachedtonode node do addNotification source:node
)
  
  
  delete objects 
  target = box name:"target" pos:[40,0,0] wirecolor:green
  source = box name:"source" wirecolor:orange
  addmodifier source (Buddy target:target)
  with animate on at time 100 
  (
  	target.pos = [40,0,100]
  	source.pos = [-100,0,0]
  )
  
 
  03 March 2013
Interesting, Had not thought about the notifyDependents. This needs the script controller how ever and in my books that is ugly. I'll have a play and see if it is anything different then what I have.

Thanks Denis.
__________________
Paul Neale
http://paulneale.com
 
  03 March 2013
Originally Posted by PEN: Interesting, Had not thought about the notifyDependents. This needs the script controller how ever and in my books that is ugly. I'll have a play and see if it is anything different then what I have.

could you modify my snippet to show your way please?
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:12 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.