Notifications
Clear all

[Closed] Parameter Wiring Syntax

Is it just me, or is getting the syntax right for parameter wiring REALLY hard? I’m writing an automated character rigging script at the moment (my first attempt at serious scripting) and every time I need to wire a parameter it takes hours of stabbing around in the dark to come up with the right syntax to get the wiring to work. Grr.

Here are two examples who’s syntax SHOULD work, but they don’t:

In this first example, I create an ExposeTM node and then try to wire the local Y of the node to the rotation of another bone – but it doesn’t work. Here’s the code:pSHLD = ExposeTm pos:ptUpArm.pos
pSHLD.exposeNode = bUA;
pSHLD.localReferenceNode = bUA;
pSHLD.parent = bCLV;
paramWire.connect pSHLD.baseObject[#Expose][#Local_Euler_Y] bSHDR.rotation.controller[2][#Y_Rotation] “Local_Euler_Y”;

This bit gives me a “no ““get”” function for undefined” error. I have no idea what that means. I know that the second part of the wiring works (bSHDR.rotation.controller[2][#Y_Rotation]) because I use that syntax in a lot of other places. It’s the first part (pSHLD.baseObject[#Expose][#Local_Euler_Y]) that Max is choking on for some reason. Anybody know why?

Here’s another example. I want to wire the weight of a list controller to a custom attribute so I can control it with a slider. Here’s the code (that doesn’t work):paramWire.connect handCTRL.modifiers[#Attribute_Holder].ArmCustom_Attributes[2] bTWST.rotation.controller.weight[3] “autoTwistPct”;

I know that the first part works (handCTRL.modifiers[#Attribute_Holder].ArmCustom_Attributes[2]) because I’m using that same syntax in other places. The second part (bTWST.rotation.controller.weight[3]) doesn’t work. This code gives me a “wiring needs subAnims” error. Does anyone know the parameter wiring syntax to wire the weight of a list controller to something else? I sure don’t. I’ve been trying to get this one for several days now with no luck.

Any and all help will be greatly appreciated!

2 Replies

Hi. Heres jsut a little bit of code i use to wire some rollbones and it works. I think it might be the first [#Expose] that you dont need.
hope that helps,

seb



local numSeg = segs.count
	for i=1 to numseg do (
		rotChannel = execute ("#"+axisToControl+"_Rotation")
		rotExp = execute ("#Local_Euler_"+axis)
		
		if not backwards then myExpression = (rollDir as string+"*Local_Euler_"+axis+"/" +((pow (numseg-i+1) (numseg-i))*1.2) as string)
				else myExpression = (rollDir as string+"*Local_Euler_"+axis+"/"+(pow (i) (i-1)*1.2) as string)

		--format "Expression for %:%
" segs[i].name myExpression
		paramWire.connect exT.baseobject[rotExp] segs[i].rotation.controller[rotChannel] myExpression
	)


sheb,

Yeah – getting rid of that expose fixed it. Now it works great! Thanks a lot!

-Ben