4
$\begingroup$

I am trying to create custom property for an object of type float array.

I tried simply adding a key value pair to object as:

bpy.context.object['test_property'] = 100

There is no error, however I can't see the property in Custom Properties of Object Data Properties Panel.

I also tried following the instructions in https://blender.stackexchange.com/a/43786 Still I am not able to see the property in the UI panel.

How do I add a property to the object via python so that it's also visible in the Custom Properties panel?

$\endgroup$
2
  • 4
    $\begingroup$ Hello ! This will create a custom property in the object property panel (orange icon). If you want to add a custom property to the object data (Green triangle icon), you'll need to access it with bpy.context.object.data['test_property'] = 100 $\endgroup$
    – Gorgious
    Commented Jan 2, 2023 at 9:06
  • 1
    $\begingroup$ @Gorgious Thank you very much. That's what I was looking for. Could you please post the comment as the answer, so that I can accept it. $\endgroup$ Commented Jan 5, 2023 at 5:18

0

You must log in to answer this question.

Browse other questions tagged .