Notifications
Clear all

[Closed] Parameter Wiring naming?

I’ve spent a lot of hours trying to figure this out, but can’t quite get the last bit to work. Anyone able to shed some light on my limited knowledge?

I’m trying to wire a few parameters together with maxscript. I have a character with animation on a morph modifier, and I need it to drive a morph modifier on a second character.
(The character is Harry.) The following script works just fine:

morphMaster = $Harry__moCap_head.modifiers[#Morpher][21]
morphSlave = $Harry__head.modifiers[#Morpher][1]
paramWire.connect morphMaster morphSlave “21__eyeBlinkLeft___No_Target

However, I have a few different characters, many morph targets, and would like to use the same script, but with the name as a variable, received from a drop-down menu.
The drop-down menu works fine…

rollout charRollout “Character Selection”
(
dropdownlist character_dd “Select Character:” items:#(“Carl”, “Harry”, “Barry”) selection:2
)

… the name gets sent out, but when I’m trying to integrate it in to my script, I get errors.

charMaster = charRollout.character_dd.selected + “__moCap_head”
charSlave = charRollout.character_dd.selected + “__head”
morphMaster = charMaster.modifiers[#Morpher][21]
morphSlave = charSlave.modifiers[#Morpher][1]
paramWire.connect morphMaster morphSlave “21__eyeBlinkLeft___No_Target

Error:
!!–Unknown property: “modifiers” in “Harry__moCap_head”

Any help is very much appreciated!

Kind regards,
Peter.

4 Replies

You need to get node by name like so:


charMaster = getNodeByName (charRollout.character_dd.selected + "__moCap_head")
charSlave   = getNodeByName (charRollout.character_dd.selected + "__head")

Ah, I was so close, and yet so far.
That’s brilliant! Thank you very much.

This has beed helpful for me trying to figure out what the maxscript for Wireparameters one characters morph target driving the other characters morph targets. I’v tried figuring it out but would really appreciate the help.

here is where I am at

morphMaster = $head.modifiers[#Morpher][25]
morphSlave = $Body.modifiers[#Morpher][36]
paramWire.connect $.modifiers[#Morpher][#25__jawOpen___Target_Available] $Body.modifiers[#Morpher][#36__MouthOpen___No_Target] “25__jawOpen___Target_Available

here is the error message
– Runtime error: connect requires subAnims
– MAXScript callstack:
– thread data: threadID:19556


– [stack level: 0]
– In top-level

You’re defining morphMaster and morphSlave at the beginning there, but then not calling them in your wiring command. So, if you only want to do this as 1 specific command, you can use:

paramWire.connect $head.modifiers[#Morpher][25] $body.modifiers[#Morpher][36] "_25__jawOpen___Target_Available_"

But if you’re going to use the master/slave setup to wire lots of parameters simultaneously then you would use something more like this:

jawOpenMaster =  $head.modifiers[#Morpher][25]
jawOpenSlave =  $body.modifiers[#Morpher][36]
paramWire.connect jawOpenMaster jawOpenSlave "_25__jawOpen___Target_Available_"

The first 2 lines there are kind of pointless unless you’re adding additional parameters that need to be defined, such as choosing different characters or setups. (You see in my original example I was choosing a character from a dropdown list, and that’s why I needed to define a Master.)

But at least from here, you can dissect and rebuild what you need.
Hope this helps!

Kind regards,
Peter.