ID properties that are displayed via RNA can now define their own UI settings,

only implimented min/max precision & step.

at the moment there is no way to edit these other then via python

example of setting UI limits...

>>> C.object['foo'] = 0.5
>>> C.object['_RNA_UI'] = {'foo': {'step': 0.5, 'soft_max': 10.0, 'soft_min': 0.0, 'precision': 2, 'description': 'Some setting'}}

Also fixed typo's: precission -> precision
This commit is contained in:
2009-11-18 20:01:35 +00:00
parent 5f6b9fd324
commit ae5a814f26
12 changed files with 175 additions and 29 deletions

View File

@@ -300,7 +300,7 @@ class OBJECT_PT_properties(ObjectButtonsPanel):
def draw(self, context):
import rna_prop_ui
# reload(rna_prop_ui)
rna_prop_ui.draw(self.layout, context, "object")
bpy.types.register(OBJECT_PT_context_object)

View File

@@ -1629,6 +1629,29 @@ class VIEW3D_PT_etch_a_ton(bpy.types.Panel):
col.itemR(toolsettings, "etch_side")
class VIEW3D_PT_context_properties(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Properties"
bl_default_closed = True
def draw(self, context):
import rna_prop_ui
# reload(rna_prop_ui)
obj = context.object
if obj:
mode = obj.mode
if mode == 'POSE':
item = "active_pchan"
elif mode == 'EDIT' and obj.type == 'ARMATURE':
item = "active_bone"
else:
item = "object"
# Draw with no edit button
rna_prop_ui.draw(self.layout, context, item, False)
# Operators
from bpy.props import *
@@ -1757,4 +1780,6 @@ bpy.types.register(VIEW3D_PT_background_image)
bpy.types.register(VIEW3D_PT_transform_orientations)
bpy.types.register(VIEW3D_PT_etch_a_ton)
bpy.types.register(VIEW3D_PT_context_properties)
bpy.ops.add(OBJECT_OT_select_pattern)