Notifications
Clear all

[Closed] rotation_reactor() with custom attributes

Hey there.
I’m using the Attribute Holder modifier on an object and would like the custom attributes I apply to the Attribute Holder to drive a rotation_reactor setup.

This works fine if I use the Reaction Manager, but if I try to do something like this:

    ikfkSwitch = ctrlObj.modifiers[#Attribute_Holder].cust_attrs.IK_FK_Switch
    
    oCon = orientation_constraint()
    oCon.appendTarget fkObj 0
    oCon.appendTarget ikObj 100
    
    oCon1 =  rotation_reactor()
    reactTo oCon1 ikfkSwitch
    setReactionState oCon1 1 100
    ikfkSwitch.value = 10
    setReactionState oCon1 2 0
    ikfkSwitch.value = 0
    oCon.weight[1].controller =oCon1

I get the following error:
Not a Controller or a Node: 0.0

I realize that I’m trying to reference the value directly, but how do I access the “node” of a custom attribute for use in a rotation_reactor?

Any hints?

Thanks,

Alec

1 Reply

OK, I solved it. I was doing a couple of things wrong.
Firstly, I was using the wrong type of reactor – I should have been using float_reactor, not rotation_reactor.

Secondly, to really answer my question, I needed to assign a bezier_float() to the custom attribute’s controller. Initially, I saw that if I tried to access the controller for the custom attr, the result was undefined.
I need to always remember that undefined doesn’t mean unavailable. In fact, if the result is undefined when speaking about a controller, I think that in every case you can assign something to that controller, in this case, bezier_float().

Once the custom attr was assigned the bezier_float, I could use it in the float_reactor().