Bugfix #20605: Shape key values not keyable from mesh data panel. Keyable from Databl...
authorJoshua Leung <aligorith@gmail.com>
Fri, 8 Jan 2010 02:02:52 +0000 (02:02 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 8 Jan 2010 02:02:52 +0000 (02:02 +0000)
See the bugreport comments for full breakdown of the fix.

--

The change in brush.c is to get blender compiling again, after my previous commit which tried to fix a compiler warning related to this (but in the header file instead).

release/scripts/ui/properties_data_mesh.py
source/blender/blenkernel/intern/brush.c
source/blender/makesrna/intern/rna_key.c

index c0f85685938b25016eaa9bc45833d861bd1701a5..b8c5438ea78c52c1122c4e8ee5bb2f24c390f773 100644 (file)
@@ -150,7 +150,12 @@ class DATA_PT_shape_keys(DataButtonsPanel):
 
         ob = context.object
         key = ob.data.shape_keys
-        kb = ob.active_shape_key
+        if key and len(key.keys):
+            # this is so that we get the active shapekey from the 
+            # shapekeys block, not from object data
+            kb = key.keys[ob.active_shape_key.name]
+        else:
+            kb = None
         wide_ui = context.region.width > narrowui
 
         enable_edit = ob.mode != 'EDIT'
index ec761c27c64b12f1cf801028ee6176b2380246a5..99cd69756656b4da7959d493377974f96124e250 100644 (file)
@@ -225,7 +225,7 @@ void brush_toggled_fake_user(Brush *brush)
        }
 }
 
-void brush_curve_preset(Brush *b, CurveMappingPreset preset)
+void brush_curve_preset(Brush *b, /*CurveMappingPreset*/int preset)
 {
        CurveMap *cm = NULL;
 
index 9e560a50af07e1a8c8875afd1f3ee2fa979e4d11..6ff961070b9c8fc94a6e88603f9651b563e447da 100644 (file)
@@ -283,7 +283,13 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
 
 static char *rna_ShapeKey_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("keys[\"%s\"]", ((KeyBlock*)ptr->data)->name);
+       KeyBlock *kb= (KeyBlock *)ptr->data;
+       ID *id= ptr->id.data;
+       
+       if ((id) && (GS(id->name) != ID_KE))
+               return BLI_sprintfN("shape_keys.keys[\"%s\"]", kb->name);
+       else
+               return BLI_sprintfN("keys[\"%s\"]", kb->name);
 }
 
 static void rna_Key_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)