Revision: 23080 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23080 Author: blendix Date: 2009-09-09 13:52:56 +0200 (Wed, 09 Sep 2009)
Log Message: ----------- 2.5: Object module * Split object_edit.c into multiple files: object_add.c, object_edit.c, object_hook.c, object_relations.c, object_select.c, object_transform.c. * Rename files to have consistent object_ and mball_ prefix: object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c. * Added operators: * vertex group menu and set active * apply location, rotation, scale, visual transform (location is new) * make local * make vertex parent * move to layer * convert to curve/mesh (not finished yet) * Many small fixes for marked issues, but still much code to be cleaned up here... Modified Paths: -------------- branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj branches/blender2.5/blender/release/ui/space_info.py branches/blender2.5/blender/source/blender/blenkernel/BKE_animsys.h branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c branches/blender2.5/blender/source/blender/blenkernel/intern/library.c branches/blender2.5/blender/source/blender/blenlib/intern/util.c branches/blender2.5/blender/source/blender/editors/armature/editarmature.c branches/blender2.5/blender/source/blender/editors/armature/editarmature_retarget.c branches/blender2.5/blender/source/blender/editors/armature/meshlaplacian.c branches/blender2.5/blender/source/blender/editors/armature/poseobject.c branches/blender2.5/blender/source/blender/editors/include/ED_armature.h branches/blender2.5/blender/source/blender/editors/include/ED_mball.h branches/blender2.5/blender/source/blender/editors/include/ED_mesh.h branches/blender2.5/blender/source/blender/editors/include/ED_object.h branches/blender2.5/blender/source/blender/editors/object/object_edit.c branches/blender2.5/blender/source/blender/editors/object/object_intern.h branches/blender2.5/blender/source/blender/editors/object/object_modifier.c branches/blender2.5/blender/source/blender/editors/object/object_ops.c branches/blender2.5/blender/source/blender/editors/object/object_vgroup.c branches/blender2.5/blender/source/blender/editors/screen/screen_context.c branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_vertex.c branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_ops.c branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c branches/blender2.5/blender/source/blender/editors/util/undo.c branches/blender2.5/blender/source/blender/makesrna/RNA_enum_types.h branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c Added Paths: ----------- branches/blender2.5/blender/source/blender/editors/metaball/mball_edit.c branches/blender2.5/blender/source/blender/editors/object/object_add.c branches/blender2.5/blender/source/blender/editors/object/object_constraint.c branches/blender2.5/blender/source/blender/editors/object/object_group.c branches/blender2.5/blender/source/blender/editors/object/object_hook.c branches/blender2.5/blender/source/blender/editors/object/object_lattice.c branches/blender2.5/blender/source/blender/editors/object/object_relations.c branches/blender2.5/blender/source/blender/editors/object/object_select.c branches/blender2.5/blender/source/blender/editors/object/object_shapekey.c branches/blender2.5/blender/source/blender/editors/object/object_transform.c Removed Paths: ------------- branches/blender2.5/blender/source/blender/editors/metaball/editmball.c branches/blender2.5/blender/source/blender/editors/object/editconstraint.c branches/blender2.5/blender/source/blender/editors/object/editgroup.c branches/blender2.5/blender/source/blender/editors/object/editkey.c branches/blender2.5/blender/source/blender/editors/object/editlattice.c Modified: branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj =================================================================== --- branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj 2009-09-09 11:52:56 UTC (rev 23080) @@ -1075,19 +1075,19 @@ Name="object" > <File - RelativePath="..\..\..\source\blender\editors\object\editconstraint.c" + RelativePath="..\..\..\source\blender\editors\object\object_constraint.c" > </File> <File - RelativePath="..\..\..\source\blender\editors\object\editgroup.c" + RelativePath="..\..\..\source\blender\editors\object\object_group.c" > </File> <File - RelativePath="..\..\..\source\blender\editors\object\editkey.c" + RelativePath="..\..\..\source\blender\editors\object\object_shapekey.c" > </File> <File - RelativePath="..\..\..\source\blender\editors\object\editlattice.c" + RelativePath="..\..\..\source\blender\editors\object\object_lattice.c" > </File> <File @@ -1110,6 +1110,10 @@ RelativePath="..\..\..\source\blender\editors\object\object_vgroup.c" > </File> + <File + RelativePath="..\..\..\source\blender\editors\object\object_hook.c" + > + </File> </Filter> <Filter Name="transform" @@ -1479,7 +1483,7 @@ Name="metaball" > <File - RelativePath="..\..\..\source\blender\editors\metaball\editmball.c" + RelativePath="..\..\..\source\blender\editors\metaball\mball_edit.c" > </File> <File Modified: branches/blender2.5/blender/release/ui/space_info.py =================================================================== --- branches/blender2.5/blender/release/ui/space_info.py 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/release/ui/space_info.py 2009-09-09 11:52:56 UTC (rev 23080) @@ -117,22 +117,22 @@ layout.operator_context = "EXEC_SCREEN" - layout.item_menu_enumO( "object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') - layout.item_menu_enumO( "object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') - layout.item_menu_enumO( "object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') - layout.item_menu_enumO( "object.metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') + layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') + layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') + layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') + layout.item_menu_enumO("object.metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT') layout.itemS() layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') - layout.item_enumO("object.object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') - layout.item_enumO("object.object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') + layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') + layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') layout.itemS() - layout.item_enumO("object.object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') - layout.item_enumO("object.object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') + layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') + layout.item_enumO("object.add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') class INFO_MT_game(bpy.types.Menu): __space_type__ = 'INFO' Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_animsys.h =================================================================== --- branches/blender2.5/blender/source/blender/blenkernel/BKE_animsys.h 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/source/blender/blenkernel/BKE_animsys.h 2009-09-09 11:52:56 UTC (rev 23080) @@ -55,6 +55,9 @@ /* Copy AnimData */ struct AnimData *BKE_copy_animdata(struct AnimData *adt); +/* Make Local */ +void BKE_animdata_make_local(struct AnimData *adt); + /* ************************************* */ /* KeyingSets API */ Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c =================================================================== --- branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c 2009-09-09 11:52:56 UTC (rev 23080) @@ -204,6 +204,32 @@ return dadt; } +/* Make Local -------------------------------------------- */ + +static void make_local_strips(ListBase *strips) +{ + NlaStrip *strip; + + for(strip=strips->first; strip; strip=strip->next) { + if(strip->act) make_local_action(strip->act); + if(strip->remap && strip->remap->target) make_local_action(strip->remap->target); + + make_local_strips(&strip->strips); + } +} + +void BKE_animdata_make_local(AnimData *adt) +{ + NlaTrack *nlt; + + if(adt->action) make_local_action(adt->action); + if(adt->tmpact) make_local_action(adt->tmpact); + if(adt->remap && adt->remap->target) make_local_action(adt->remap->target); + + for(nlt=adt->nla_tracks.first; nlt; nlt=nlt->next) + make_local_strips(&nlt->strips); +} + /* *********************************** */ /* KeyingSet API */ Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/library.c =================================================================== --- branches/blender2.5/blender/source/blender/blenkernel/intern/library.c 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/source/blender/blenkernel/intern/library.c 2009-09-09 11:52:56 UTC (rev 23080) @@ -194,7 +194,10 @@ case ID_WV: return 0; /* deprecated */ case ID_LT: - if(!test) make_local_lattice((Lattice*)id); + if(!test) { + make_local_lattice((Lattice*)id); + make_local_key(((Lattice*)id)->key); + } return 1; case ID_LA: if(!test) make_local_lamp((Lamp*)id); Modified: branches/blender2.5/blender/source/blender/blenlib/intern/util.c =================================================================== --- branches/blender2.5/blender/source/blender/blenlib/intern/util.c 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/source/blender/blenlib/intern/util.c 2009-09-09 11:52:56 UTC (rev 23080) @@ -77,14 +77,9 @@ #include "BLI_winstuff.h" -/* for duplicate_defgroup */ -#if !(defined vsnprintf) -#define vsnprintf _vsnprintf #endif -#endif - #ifndef WIN32 #include <sys/time.h> #endif Modified: branches/blender2.5/blender/source/blender/editors/armature/editarmature.c =================================================================== --- branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-09-09 11:10:28 UTC (rev 23079) +++ branches/blender2.5/blender/source/blender/editors/armature/editarmature.c 2009-09-09 11:52:56 UTC (rev 23080) @@ -239,7 +239,7 @@ } /* put EditMode back in Object */ -void ED_armature_from_edit(Scene *scene, Object *obedit) +void ED_armature_from_edit(Object *obedit) { bArmature *arm= obedit->data; EditBone *eBone, *neBone; @@ -343,21 +343,19 @@ DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); } - - -void apply_rot_armature (Scene *scene, Object *ob, float mat[3][3]) +void ED_armature_apply_transform(Object *ob, float mat[4][4]) { EditBone *ebone; bArmature *arm= ob->data; - float scale = Mat3ToScalef(mat); /* store the scale of the matrix here to use on envelopes */ + float scale = Mat4ToScalef(mat); /* store the scale of the matrix here to use on envelopes */ /* Put the armature into editmode */ ED_armature_to_edit(ob); /* Do the rotations */ for (ebone = arm->edbo->first; ebone; ebone=ebone->next){ - Mat3MulVecfl(mat, ebone->head); - Mat3MulVecfl(mat, ebone->tail); + Mat4MulVecfl(mat, ebone->head); + Mat4MulVecfl(mat, ebone->tail); ebone->rad_head *= scale; ebone->rad_tail *= scale; @@ -365,7 +363,7 @@ } /* Turn the list into an armature */ - ED_armature_from_edit(scene, ob); + ED_armature_from_edit(ob); ED_armature_edit_free(ob); } @@ -411,7 +409,7 @@ } /* Turn the list into an armature */ - ED_armature_from_edit(scene, ob); + ED_armature_from_edit(ob); /* Adjust object location for new centerpoint */ if(centermode && obedit==NULL) { @@ -557,7 +555,7 @@ } /* convert editbones back to bones */ - ED_armature_from_edit(scene, ob); + ED_armature_from_edit(ob); /* flush positions of posebones */ where_is_pose(scene, ob); @@ -791,7 +789,7 @@ DAG_scene_sort(scene); // because we removed object(s) - ED_armature_from_edit(scene, ob); + ED_armature_from_edit(ob); ED_armature_edit_free(ob); WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene); @@ -994,7 +992,7 @@ } /* exit editmode (recalculates pchans too) */ - ED_armature_from_edit(scene, ob); + ED_armature_from_edit(ob); ED_armature_edit_free(ob); } @@ -1037,7 +1035,7 @@ oldob->mode &= ~OB_MODE_POSE; //oldbase->flag &= ~OB_POSEMODE; - ED_armature_from_edit(scene, obedit); + ED_armature_from_edit(obedit); ED_armature_edit_free(obedit); /* 2) duplicate base */ @@ -4334,7 +4332,7 @@ /* in weightpaint we select the associated vertex group too */ if (ob->mode & OB_MODE_WEIGHT_PAINT) { if (nearBone->flag & BONE_ACTIVE) { - vertexgroup_select_by_name(OBACT, nearBone->name); + ED_vgroup_select_by_name(OBACT, nearBone->name); DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); } } @@ -4445,7 +4443,7 @@ return 0; } -static int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data) +static int ED_vgroup_add_unique_bone(Object *ob, Bone *bone, void *data) { /* This group creates a vertex group to ob that has the * same name as bone (provided the bone is skinnable). @@ -4453,7 +4451,7 @@ */ if (!(bone->flag & BONE_NO_DEFORM)) { if (!get_named_vertexgroup(ob,bone->name)) { - add_defgroup_name(ob, bone->name); + ED_vgroup_add_name(ob, bone->name); return 1; } } @@ -4497,7 +4495,7 @@ segments = 1; if (!(defgroup = get_named_vertexgroup(ob, bone->name))) @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs