- 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.
This commit is contained in:
Campbell Barton
2010-12-07 12:51:03 +00:00
parent b5c2f9df95
commit a98fc7500d
3 changed files with 12 additions and 7 deletions

View File

@@ -88,7 +88,7 @@ class OBJECT_PT_delta_transform(ObjectButtonsPanel, bpy.types.Panel):
#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")

View File

@@ -94,11 +94,16 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
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 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
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()

View File

@@ -825,11 +825,11 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr)
#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 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
/* 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);