[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27833] branches/render25: ability to pin any object into the context

Campbell Barton ideasman42 at gmail.com
Mon Mar 29 14:33:33 CEST 2010


Revision: 27833
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27833
Author:   campbellbarton
Date:     2010-03-29 14:33:33 +0200 (Mon, 29 Mar 2010)

Log Message:
-----------
ability to pin any object into the context

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_object.py
    branches/render25/source/blender/makesrna/intern/rna_space.c

Modified: branches/render25/release/scripts/ui/properties_object.py
===================================================================
--- branches/render25/release/scripts/ui/properties_object.py	2010-03-29 10:37:13 UTC (rev 27832)
+++ branches/render25/release/scripts/ui/properties_object.py	2010-03-29 12:33:33 UTC (rev 27833)
@@ -35,12 +35,15 @@
 
     def draw(self, context):
         layout = self.layout
-
+        space = context.space_data
         ob = context.object
 
         row = layout.row()
         row.label(text="", icon='OBJECT_DATA')
-        row.prop(ob, "name", text="")
+        if space.use_pin_id:
+            row.template_ID(space, "pin_id")
+        else:
+            row.prop(ob, "name", text="")
 
 
 class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel):

Modified: branches/render25/source/blender/makesrna/intern/rna_space.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/rna_space.c	2010-03-29 10:37:13 UTC (rev 27832)
+++ branches/render25/source/blender/makesrna/intern/rna_space.c	2010-03-29 12:33:33 UTC (rev 27833)
@@ -1148,6 +1148,10 @@
 	RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);
+
+	prop= RNA_def_property(srna, "use_pin_id", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_PIN_CONTEXT);
+	RNA_def_property_ui_text(prop, "Pin ID", "Use the pinned context");
 }
 
 static void rna_def_space_image(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list