[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33539] trunk/blender: - fix for crash with constraint UI when using with a pinner object, with None active.

Campbell Barton ideasman42 at gmail.com
Tue Dec 7 13:51:04 CET 2010


Revision: 33539
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33539
Author:   campbellbarton
Date:     2010-12-07 13:51:03 +0100 (Tue, 07 Dec 2010)

Log Message:
-----------
- fix for crash with constraint UI when using with a pinner object, with None active.
- fix for material UI when the pinned data was not a material.
- fix an error axis-angle drot label.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_object.py
    trunk/blender/release/scripts/ui/properties_texture.py
    trunk/blender/source/blender/editors/interface/interface_templates.c

Modified: trunk/blender/release/scripts/ui/properties_object.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_object.py	2010-12-07 12:29:51 UTC (rev 33538)
+++ trunk/blender/release/scripts/ui/properties_object.py	2010-12-07 12:51:03 UTC (rev 33539)
@@ -88,7 +88,7 @@
             #row.column().prop(pchan, "delta_rotation_angle", text="Angle")
             #row.column().prop(pchan, "delta_rotation_axis", text="Axis")
             #row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation")
-            row.column().label(ob, text="Not for Axis-Angle")
+            row.column().label(text="Not for Axis-Angle")
         else:
             row.column().prop(ob, "delta_rotation_euler", text="Rotation")
 

Modified: trunk/blender/release/scripts/ui/properties_texture.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_texture.py	2010-12-07 12:29:51 UTC (rev 33538)
+++ trunk/blender/release/scripts/ui/properties_texture.py	2010-12-07 12:51:03 UTC (rev 33539)
@@ -94,11 +94,16 @@
         space = context.space_data
         tex = context.texture
         idblock = context_tex_datablock(context)
-        tex_collection = space.pin_id is None and type(idblock) != bpy.types.Brush and not node
+        pin_id = space.pin_id
 
+        if type(pin_id) != bpy.types.Material:
+            pin_id = None
+
+        tex_collection = pin_id is None and type(idblock) != bpy.types.Brush and not node
+
         if tex_collection:
             row = layout.row()
-
+            
             row.template_list(idblock, "texture_slots", idblock, "active_texture_index", rows=2)
 
             col = row.column(align=True)
@@ -116,7 +121,7 @@
         elif idblock:
             col.template_ID(idblock, "texture", new="texture.new")
 
-        if space.pin_id:
+        if pin_id:
             col.template_ID(space, "pin_id")
 
         col = split.column()

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c	2010-12-07 12:29:51 UTC (rev 33538)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c	2010-12-07 12:51:03 UTC (rev 33539)
@@ -825,11 +825,11 @@
 #define REMAKEIPO					8
 #define B_DIFF						9
 
-void do_constraint_panels(bContext *C, void *UNUSED(arg), int event)
+void do_constraint_panels(bContext *C, void *ob_pt, int event)
 {
 	Main *bmain= CTX_data_main(C);
 	Scene *scene= CTX_data_scene(C);
-	Object *ob= CTX_data_active_object(C);
+	Object *ob= (Object *)ob_pt;
 	
 	switch(event) {
 	case B_CONSTRAINT_TEST:
@@ -898,7 +898,7 @@
 
 	/* unless button has own callback, it adds this callback to button */
 	block= uiLayoutGetBlock(layout);
-	uiBlockSetHandleFunc(block, do_constraint_panels, NULL);
+	uiBlockSetHandleFunc(block, do_constraint_panels, ob);
 	uiBlockSetFunc(block, constraint_active_func, ob, con);
 
 	RNA_pointer_create(&ob->id, &RNA_Constraint, con, &ptr);





More information about the Bf-blender-cvs mailing list