[Closed] Extended Morpher WM3_MC
Hi,
I am having problem with extended morpher modifier plugin. I am unable to find any more help on the web about this. None of WM3_MC methods for the classic Max Morpher modifier does work. (they don’t crash, they actually return FALSE value :banghead: )
Test the code below and you will se what is the problem, I just hope I’ve missed little something in the plugin definition.
try(delete #(a,b))catch()
plugin modifier MorpherExtended
name:"MorpherExtended"
classID:#(1025450437, -873296458)
invisible:false
extends:Morpher
replaceUI:false
version:1
(
)
a = convertto (box()) Editable_Mesh
b = snapshot a
b.pos.x += 30
addmodifier a (MorpherExtended())
myExtMorpher = a.MorpherExtended
print myExtMorpher
WM3_MC_BuildFromNode myExtMorpher 1 b -- returning FALSE
/* if you add manually the object and call this, it gives you False as well*/
WM3_MC_GetName a.MorpherExtended 1
select a
Thanks for any help
TM
you can’t use WM3_MC interface directly with Extended Morpher. All WM3_MC methods work for Morpher Class only. So you have to call the delegated class:
modi = MorpherExtended()
IsValidMorpherMod classof modi -- FALSE
IsValidMorpherMod classof modi.delegate -- TRUE
also it’s better to add autoPromoteDelegateProps:on to the plugin definition (see MXS help for details).
PS. I didn’t test all WM3_MC methods for delegated morpher. And I’m not sure that all of them work right. So I suggest to extend the Morpher by using a Custom Attribute(s).
Thank you Denis, access trought .delegate is absolutelly sufficient
I’ve tested most of the methods and it works fine.
I was using Custom Attributes, but I can’t spam with so many data in this case other artists Morphers. Thanks again, it helped :buttrock:
there is a working sample for other interested
fn MorpherAccess morpher b channel = (
IsValidMorpherMod morpher
WM3_MC_BuildFromNode morpher channel b
WM3_MC_GetName morpher channel
WM3_MC_HasData morpher channel
WM3_MC_GetValue morpher channel
WM3_MC_GetName morpher channel
WM3_MC_GetTarget morpher channel
WM3_MC_GetUseLimits Morpher channel
WM3_MC_GetUseVertexSel Morpher channel
WM3_MC_GetValue Morpher channel
WM3_MC_HasData Morpher channel
WM3_MC_HasTarget Morpher channel
WM3_MC_IsActive Morpher channel
WM3_MC_IsValid Morpher channel
WM3_MC_NumMPts Morpher channel
WM3_MC_NumPts Morpher channel
WM3_MC_Rebuild Morpher channel
WM3_MC_SetName Morpher channel "smilie"
WM3_MC_SetUseLimits Morpher channel False
WM3_MC_SetUseVertexSel Morpher channel True
WM3_MC_SetValue Morpher channel 100.0
WM3_RebuildInternalCache Morpher
WM3_RefreshChannelListUI Morpher
WM3_RefreshChannelParamsUI Morpher
)
plugin modifier MorpherExtended
name:"MorpherExtended"
classID:#(1025450437, -873296458)
invisible:false
extends:Morpher
replaceUI:false
version:1
autoPromoteDelegateProps:true
(
)
a = convertto (box()) Editable_Mesh
b = snapshot a
b.pos.x += 30
addmodifier a (MorpherExtended())
mymorpher = a.MorpherExtended.delegate
MorpherAccess mymorpher b 1