Max : exposing animateable parameters that don't appear in the parameter wire dialog

Is there any way to do this?

purely as an example…

I’d like to place a button in an attribute holder modifier on an object that enables/disables an HI IK solver somewhere else in the scene.

the enable/disable track is keyable so I can’t see why this isn’t doable - I dicked around with the parameter collecter and things but got nowhere through the interface.

Before I start bashing my head against a wall and trying to access it via maxscript does anyone know a way?

many thanks :slight_smile:

Getting one object to control the “enabled” option of an IK chain is an esoteric example - parameters of IK chains are uniquely confusing within max and should probably not ever be touched by sane people.

The problem with the “enabled” parameter of an IK Chain is that it happens to be quite odd. The ‘enabled’ parameter is controlled by a button, but it’s actually a float with a range of 0.0 to 1.0. It’s not possible to change the controller for this attribute and as far as I can tell, there’s not a way wire this parameter through the UI because the value of ‘enabled’ is a ‘float’ while it only accepts wire connections from booleans.

If we want another object within the scene to be able to control this value, we can alternatively create a custom attribute that points to the IK chain and controls the ‘enabled’ value. Here’s a simple custom attribute that controls the enabled/disabled value of a referenced IK chain.


-- create an attribute
testAttributeDef = attributes testAttribute
(
	parameters testAttributes rollout:testAttributesUI
	(
		'ikObj' type:#maxObject
		'ikToggleVal' type:#float ui:spn_toggle_ik

	)
	
	rollout testAttributesUI "enable/disable IK"
	(
		-- the attribute UI within the modifier panel 
		spinner spn_toggle_ik range:[0,1, 1]  type:#float controller:ikObj.node.transform.controller.enabled.controller
		
	)
	
)
-- so we dont get errors (the attribute holder will pop up an exception if we view it before all paramters are assigned) 
max create mode

-- create an empty modifier to add the attribute to 
newMod = EmptyModifier()

-- just for fun, add the modifier to a box
addModifier $Box01 newMod

-- add the attribute to the modifier (not the object).
-- assuming we only have one modifier. 
custAttributes.add $Box01.modifiers[1] testAttributeDef

-- assign the IkNode to the ik
$Box01.modifiers[1].ikObj = NodeTransformMonitor node:$ikChain forwardTransformChangeMsgs: false

We can add this custom attribute to whatever we want within the scene and control an IKchain’s ‘enabled’. This attribute works by keeping a reference to an ikchain within the parameter ‘ikObj’, and then wiring a float spinner to the referenced object’s ‘enable’ parameter.

Confused yet?

Believe it or not I’ve seen weirder (was a web developer in the late 90s), it pleases me that I was dealing with something a little “special” and I’m not as dim as I thought I might be.

Many thanks for the solution - as per usual it’s simpler than the reason for needing it :smiley: