2

Here's what I'm trying to do:

reference_object= bpy.context.active_object
reference_object.add_variable(name='some_property',value=5)
reference_object.some_property

and it would print back 5

I basically am trying to add a property to an object that's already been created and does not have the particular variable I'm trying to add in it's class. I tried looking up how to do this but I cannot seem to understand some of the other posts. Any advice would be great.

1 Answer 1

2

You can simply do:

reference_object['some_property'] = 5

And then access it:

reference_object['some_property']
# Prints back 5
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.