View Python: Setting Priorities
The following function can be used to set Priorities for objects that can have specific priorities(things like IK tags, constraints, morphs, etc. etc.).
def SetPriority(Mode, Value, obj): pd=obj[c4d.EXPRESSION_PRIORITY] pd.SetPriorityValue(c4d.PRIORITYVALUE_MODE, Mode) pd.SetPriorityValue(c4d.PRIORITYVALUE_PRIORITY, Value) obj[c4d.EXPRESSION_PRIORITY]=pd return
Mode: Relates to the Drop down for the Priority. Should be populated with an int between 0-4.
0: Initial
1: Animation
2: Expression
3: Dynamics(R11.5)
4: Generators.
Anything over 4 will result in a Blank drop down.
Value: This is the number value you want to set your priority to. You have a range of 0-499.
obj: This is the object/tag that you want to set the Priority Data to.
Here’s an example of how to use it. First create a cube, then add a constraint tag onto it. With the Cube selected try the following code in your main function:
def main(): tag=op.GetFirstTag() SetPriority(4,100, tag)