diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-22 09:19:30 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-22 09:19:30 +0300 |
commit | bb43bee5f54a2a82d0714182469cfc2c8f05b2b4 (patch) | |
tree | 0ff38510f797a64b5130dbcdc69203563d144dcc /source/blender/editors/object/object_transform.c | |
parent | 288a08849b8f8cdef295474088ebb952b88b4d4f (diff) |
Missing Transform Menus + Buggy Object Operators:
* Added missing menus, 'Transform' and 'Mirror'
- mirror menu seems to be resulting in some memory leaks with RNA_enum_items_add len: 160 038832F8
* Apply Rotation operator for Objects now takes into account the different rotation modes
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 48db13c0709..5bed3751059 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -475,8 +475,14 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo ob->loc[0]= ob->loc[1]= ob->loc[2]= 0.0f; if(apply_scale) ob->size[0]= ob->size[1]= ob->size[2]= 1.0f; - if(apply_rot) + if(apply_rot) { ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0f; + ob->quat[1]= ob->quat[2]= ob->quat[3]= 0.0f; + ob->rotAxis[0]= ob->rotAxis[2]= 0.0f; + ob->rotAngle= 0.0f; + + ob->quat[0]= ob->rotAxis[1]= 1.0f; + } where_is_object(scene, ob); ignore_parent_tx(bmain, scene, ob); @@ -501,10 +507,16 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { where_is_object(scene, ob); - + VECCOPY(ob->loc, ob->obmat[3]); - mat4_to_size( ob->size,ob->obmat); - mat4_to_eul( ob->rot,ob->obmat); + mat4_to_size(ob->size,ob->obmat); + + if (ob->rotmode == ROT_MODE_QUAT) + mat4_to_quat(ob->quat, ob->obmat); + else if (ob->rotmode == ROT_MODE_AXISANGLE) + mat4_to_axis_angle(ob->rotAxis, &ob->rotAngle, ob->obmat); + else + mat4_to_eul(ob->rot,ob->obmat); where_is_object(scene, ob); @@ -641,14 +653,6 @@ void texspace_edit(Scene *scene, View3D *v3d) } } -/************************ Mirror Menu ****************************/ - -void mirrormenu(void) -{ -// XXX initTransform(TFM_MIRROR, CTX_NO_PET); -// XXX Transform(); -} - /********************* Set Object Center ************************/ static EnumPropertyItem prop_set_center_types[] = { |