Revision: 32516
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32516
Author:   aligorith
Date:     2010-10-16 13:52:30 +0200 (Sat, 16 Oct 2010)

Log Message:
-----------
Added panel for accessing the "delta transforms" for Objects (this is closed by 
default to not clutter that much).

This should help silence complaints from some about "dloc",etc. not being 
easily keyable. 

It's also a nice way to have instances of animated objects located in different 
places, by animating either the standard transforms or the deltas, and then 
modifying by not animating the other version to keep the instances from going 
to a single point. This was a common newbie problem in 2.4x.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_object.py
    trunk/blender/source/blender/blenkernel/intern/object.c

Modified: trunk/blender/release/scripts/ui/properties_object.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_object.py       2010-10-16 
11:30:41 UTC (rev 32515)
+++ trunk/blender/release/scripts/ui/properties_object.py       2010-10-16 
11:52:30 UTC (rev 32516)
@@ -68,8 +68,33 @@
         row.column().prop(ob, "scale")
 
         layout.prop(ob, "rotation_mode")
+               
+class OBJECT_PT_delta_transform(ObjectButtonsPanel, bpy.types.Panel):
+    bl_label = "Delta Transform"
+    bl_options = {'DEFAULT_CLOSED'}
 
+    def draw(self, context):
+        layout = self.layout
 
+        ob = context.object
+
+        row = layout.row()
+
+        row.column().prop(ob, "delta_location")
+        if ob.rotation_mode == 'QUATERNION':
+            row.column().prop(ob, "delta_rotation_quaternion", text="Rotation")
+        elif ob.rotation_mode == 'AXIS_ANGLE':
+            #row.column().label(text="Rotation")
+            #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")
+        else:
+            row.column().prop(ob, "delta_rotation_euler", text="Rotation")
+
+        row.column().prop(ob, "delta_scale")
+
+
 class OBJECT_PT_transform_locks(ObjectButtonsPanel, bpy.types.Panel):
     bl_label = "Transform Locks"
     bl_options = {'DEFAULT_CLOSED'}

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c     2010-10-16 
11:30:41 UTC (rev 32515)
+++ trunk/blender/source/blender/blenkernel/intern/object.c     2010-10-16 
11:52:30 UTC (rev 32516)
@@ -1646,7 +1646,7 @@
        size_to_mat3( mat,vec);
 }
 
-// TODO: this should take rotation orders into account later...
+
 void object_rot_to_mat3(Object *ob, float mat[][3])
 {
        float rmat[3][3], dmat[3][3];
@@ -1675,7 +1675,6 @@
        }
        
        /* combine these rotations */
-       // XXX is this correct? if errors, change the order of multiplication...
        mul_m3_m3m3(mat, dmat, rmat);
 }
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to