1
$\begingroup$

Is there any way to assign an order to multiple objects such that the index of each object can be used as a driving variable?

$\endgroup$
1
  • 3
    $\begingroup$ You can add custom properties to an object in the objects panel if thats what you want. Rearranging the object index bpy.data.objects[index] sounds like it wouldn't work easily. $\endgroup$
    – Dimali
    May 3 '17 at 20:32
1
$\begingroup$
import bpy
bpy.types.Object.index = bpy.props.FloatProperty() #Create new property 'index'
obs = bpy.context.selected_objects
i=0
for ob in obs: #Object created last will be in the first iteration and so on
  ob.index=i   #Assign value for selected objects in reversed order of creation
  i+=1
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.