Notifications
Clear all

[Closed] Scripted modifier like CreaseSet

Hello! I want to make something like CreaseSet modifier which comes with 2015 max ext for older versions of max. I want it use it with http://www.magicpics.com/mps/mps_opensubdiv.html .

In my vision of this modifier edges “groups” can be Selection Sets, so modifier will get edges by Selection Sets and value of weights from the UI. Then it will set weights by polyops. It must be worked with animated weights.

First part it seems works, but I’m stuck I can’t get it works with animated value.


plugin modifier TestMod
	name:"TestMod"
	extends:Poly_Select replaceUI:true 
	classID:#(0x77fb2072, 0x3463858a)
	version:1
(

parameters main rollout:params
(
test_param1 type:#float ui:test_param1
)
rollout params "Params"
(
spinner test_param1 range:[0.0,1.0,0]
	
	
	on test_param1 changed val do
	(
	obj = refs.dependentNodes this
	polyop.setEDataValue obj[1].baseobject 1 547 val
	)
)
)

It seems it only updates when I change UI but doesn’t work if float value animated. Any suggestions?

p.s. Before scripted modifier I tried custom attributes but with same results. It seems custom attributes anyway dead end http://forums.cgsociety.org/showthread.php?t=607545

4 Replies

You have to add:
animatable:true

please refer to the maxscript help topic: scripted plugin classes.

<name> type:<#name> [tabSize:<integer>] [tabSizeVariable:<boolean>] [default:<operand>] [animatable:<boolean>] [subAnim:<boolean>] [ui:<ui_def>]

eg:
height1 type:#index animatable:true default:1 ui:height1

Thanks,
Videep

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

can continue to read

The optional parameter animatable:<boolean> specifies whether the parameter is animatable and hence visible in the track view. Only those base types marked as animatable in the above type list can be specified as animatable. Defaults to true.


  plugin modifier TestMod
  	name:"TestMod"
  --	extends:Poly_Select replaceUI:true 
  	classID:#(0x77fb2072, 0x3463858a)
  	version:1
  (
  
  parameters main rollout:params
  (
  test_param1 type:#float ui:test_param1_spn animatable:true
  
  on test_param1 set val do 
  (
  print "set val"	
  val
  )
  	
  on test_param1 get val do 
  (
  obj = refs.dependentNodes this
  polyop.setEDataValue obj[1].baseobject 1 547 val
  print val
  val
  )
  )
  rollout params "Params"
  (
  spinner test_param1_spn range:[0.0,1.0,0]
  
  on test_param1_spn changed val do
  (
  print "changed ui val"
  )
  
  )
  )
  
  

I figured out how to get it work.
Strange but extended Poly_Select does not call “get val” when rollout not active in mod panel. Anyway I don’t think that I need poly_select.

Next… problem with UI… I want make it simple, so “crease” management would be max’s SelectionSet tools.
So, I can N dropdown menus with list of poly Selection Sets (end update button) or go trough custom attributes with “Add/Delete” buttons …

Ok, another problem.

When I try to get named selection set from base Editable_Poly max drops error because my modifier changes classof of object.


$.edges.selSetNames
-- Runtime error: Mesh operation on non-mesh: PolyMesh

Any one have ideas how to get from inside my modifier baseobject’s edges Selection Sets?

I cant switch to base lavel trough modPanel …