利用者:Raa/Addons/Pie Menu Editor/Editors/Property

提供: wiki
< 利用者:Raa‎ | Addons‎ | Pie Menu Editor‎ | Editors
2018年6月29日 (金) 06:24時点におけるYamyam (トーク | 投稿記録)による版 (1版 をインポートしました)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

Property Editor

The editor allows you to register new Properties without coding.


Supported Property Types

  • BoolProperty
  • IntProperty
  • FloatProperty
  • StringProperty
  • EnumProperty
  • Vector properties


Usage


Storing Values

By default PME stores property values in Add-on Preferences. If you want to store some custom data in .blend files you need to assign the property to some type.

For example, if you assign MyProperty to Object type, the data will be stored in .blend files for each object in the scene:

Pme prop storing.png


Now you can use MyProperty like any other Object`s property:

C.object.MyProperty = True


Functions

Pme prop funcs.png


Scripting

To get the value of the Property by its name use props() function:

value = props("MyProperty")
value = props().MyProperty

To set the value use:

props("MyProperty", value)
props().MyProperty = value

Custom tab usage example:

L.prop(props(), "MyBoolProperty", slot, icon='COLOR_GREEN' if props("MyBoolProperty") else 'COLOR_RED')


Examples

Slider

Pme prop slider.png


Color Widget

Pme prop color.png


Direction Widget

Pme prop direction.png


Icon-Only Tab Bar

Pme prop tabbar.png


Directory Path

Pme prop path.png