- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I explicitly name a valid morph target in the scene with the following:
WM3_MC_BuildFromNode $Head_Base_Mesh.morpher 1 (getNodeByName " MT_Object_Name")
I get the expected result with the morph target being added to channel 1 of the morpher modifier.
However, when trying to load the same valid morph targets from an array of these objects as follows:
for i = 1 to a.count do(
MT_Name = a[i].name
WM3_MC_BuildFromNode $Head_Base_Mesh.morpher i (getNodeByName MT_Name)
)
Nothing happens. There are no error messages, but the morph targets are not added to the channels of the named Morpher modifier. Similarly, the following variations produce no error messages but with nothing being added to the morpher modifier:
--No errors but no added morph targets
for i = 1 to a.count do(
WM3_MC_BuildFromNode $Head_Base_Mesh.morpher i a[i]
)
OR
for i = 1 to a.count do(
WM3_MC_BuildFromNode $Head_Base_Mesh.morpher i (getNodeByName a[i].name)
)
The following variation of the WM3_MC_BuildFromNode statement,
WM3_MC_BuildFromNode $Head_Base_Mesh.morpher i (getNodeByName (a[i] as string))
produces the following error:
-- Error occurred in anonymous codeblock; filename: E:\3ds Max 2020\Scripts in Progress\Morpher target script.ms; position: 2684; line: 71
-- Type error: WM3_MC_BuildFromNode [Morpher Modifier] [Channel Index] [Target] requires Object, got: undefined
Any help would be appreciated. After reading through the Max documentation and checking for anything helpful online, I am stuck. Overall goal is to load an array of morph targets into the channels of a morpher modifier which seems like it should be simple and WM3_MC_BuildFromNode seems to be well suited for it, but apparently I am missing something basic here. Thanks in advance for any guidance.
Solved! Go to Solution.