Post #1391: ![](https://blenderartists.org/user_avatar/blenderartists.org/draguu/48/15444_2.

📋 Metadata

  • Author: roaoao
  • Date: 2018-05-10 13:15:41
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_01390

🏷️ Tags

v1-15-1 property scripting custom-properties intermediate solved

  • Property Editor
  • Custom Scripting
  • StringProperty
  • Conditional Display

💬 Content

draguu:

how do i add context wise properties ,
like i want string prop for every object in scene , and so we can write different string for every object

Cool feature. Will add it in the next version.
In the current version (PME 1.15.1) you can add a new StringProperty with these Getter and Setter slots:

# Getter:
return C.active_object.get(menu, "Default Value")
# Setter:
C.active_object[menu] = value

Where menu is the name of the string property.

draguu:

how do i add conditions like , if bool prop is on , only then show this enum prop

You can do this in Custom tab using props() function:

L.prop(props(), "MyEnum") if props("MyBool") else None

🔗 View on Blender Artists