Notifications
Clear all

[Closed] Creation of Custom Attribute Problem

Hi CGTalk,

I am building an autorigger for 3ds max and right now I find myself stuck with a problem that can’t be solve with the help file, neither the Internet. Below is the problem simplify has possible.

I have a problem with the creation of custom attribute, specially the spinner. I am not able to create what I do manually without any script. In the next image, you will find the result of my script on the left and on the right you will see what I want to achieve.

This is the code use for the custom attribute on the left:

		eM = emptyModifier()		
		eM.name = "OneModifier"
		addModifier $Box001 eM
		IK_FK_Switcher_Custom_Attribute = attributes custom_Attributes
(
	Rollout IKSwitchRollout "IK FK Switch"
	(
		spinner spinneRange "IK_to_FK " type:#Float range:[0,100,0] fieldwidth: 40 tooltip: "Zero equal IK, hundred equal FK."
	)
)
custAttributes.add $Box001.modifiers[1] IK_FK_Switcher_Custom_attribute

I need what’s on the right side to be able to access those value via wireparameter with my script for the autorigger.

I will be tankful if somebody could help me find an answer.

2 Replies

Hi Anthony,

Your main problem is you haven’t written a parameter block into the attribute. So there is no controller to bind to.


IK_FK_Switcher_Custom_Attribute = attributes IKFKAttr
(
	parameters main rollout:IKSwitchRollout
	(
		IKFK type:#Float default:0 ui:spinneRange
	)

	Rollout IKSwitchRollout "IK FK Switch"
	(
		spinner spinneRange "IK_to_FK " type:#Float range:[0,100,0] fieldwidth: 40 tooltip: "Zero equal IK, hundred equal FK."
	)
)

You need to provide subanmis to use paramwire.connect via MXS. If you turn on the the macroRecorder and manually connect the wire, you’ll be able to see how the command can be formatted in your code.

probably something like this from the look of your example, but it depends which way you want the wiring to go –

paramWire.connect $box001.modifiers[#OneModifier].FKIKAttr[#ikfk] $box002.modifiers[#Attribute_Holder].Custom_attributes[#IK_to_FK] "ikfk"

Hi Pete,

I really appreciate your answer.

I was thinking about that, no value declare in the script but the type:#Float tell me not in some sort. I find the problem weird so that’s the reason why I post my question here.

With your explanation, the help page about Custom Attribute make more sense right now.

About the wire, the modifier is instanciate over each controllers. The wireparameter are only for bones and position/orientation constraints. Less problem to handle.