Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_edit.c
| Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | bool ED_object_editmode_load(Object *obedit) | ||||
| return ED_object_editmode_load_ex(G.main, obedit, false); | return ED_object_editmode_load_ex(G.main, obedit, false); | ||||
| } | } | ||||
| void ED_object_editmode_exit(bContext *C, int flag) | void ED_object_editmode_exit(bContext *C, int flag) | ||||
| { | { | ||||
| /* Note! only in exceptional cases should 'EM_DO_UNDO' NOT be in the flag */ | /* Note! only in exceptional cases should 'EM_DO_UNDO' NOT be in the flag */ | ||||
| /* Note! if 'EM_FREEDATA' isn't in the flag, use ED_object_editmode_load directly */ | /* Note! if 'EM_FREEDATA' isn't in the flag, use ED_object_editmode_load directly */ | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| const bool freedata = (flag & EM_FREEDATA) != 0; | const bool freedata = (flag & EM_FREEDATA) != 0; | ||||
| if (flag & EM_WAITCURSOR) waitcursor(1); | if (flag & EM_WAITCURSOR) waitcursor(1); | ||||
| if (ED_object_editmode_load_ex(CTX_data_main(C), obedit, freedata) == false) { | if (ED_object_editmode_load_ex(CTX_data_main(C), obedit, freedata) == false) { | ||||
| /* in rare cases (background mode) its possible active object | /* in rare cases (background mode) its possible active object | ||||
| * is flagged for editmode, without 'obedit' being set [#35489] */ | * is flagged for editmode, without 'obedit' being set [#35489] */ | ||||
| Show All 38 Lines | void ED_object_editmode_exit(bContext *C, int flag) | ||||
| /* This way we ensure scene's obedit is copied into all CoW scenes. */ | /* This way we ensure scene's obedit is copied into all CoW scenes. */ | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| } | } | ||||
| void ED_object_editmode_enter(bContext *C, int flag) | void ED_object_editmode_enter(bContext *C, int flag) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | ViewLayer *sl = CTX_data_view_layer(C); | ||||
| Object *ob; | Object *ob; | ||||
| bool ok = false; | bool ok = false; | ||||
| if (ID_IS_LINKED(scene)) return; | if (ID_IS_LINKED(scene)) return; | ||||
| if ((flag & EM_IGNORE_LAYER) == 0) { | if ((flag & EM_IGNORE_LAYER) == 0) { | ||||
| ob = CTX_data_active_object(C); /* active layer checked here for view3d */ | ob = CTX_data_active_object(C); /* active layer checked here for view3d */ | ||||
| ▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | void OBJECT_OT_posemode_toggle(wmOperatorType *ot) | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = posemode_exec; | ot->exec = posemode_exec; | ||||
| ot->poll = ED_operator_object_active_editable; | ot->poll = ED_operator_object_active_editable; | ||||
| /* flag */ | /* flag */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| static void copymenu_properties(SceneLayer *sl, Object *ob) | static void copymenu_properties(ViewLayer *sl, Object *ob) | ||||
| { | { | ||||
| //XXX no longer used - to be removed - replaced by game_properties_copy_exec | //XXX no longer used - to be removed - replaced by game_properties_copy_exec | ||||
| bProperty *prop; | bProperty *prop; | ||||
| Base *base; | Base *base; | ||||
| int nr, tot = 0; | int nr, tot = 0; | ||||
| char *str; | char *str; | ||||
| prop = ob->prop.first; | prop = ob->prop.first; | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (prop) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| MEM_freeN(str); | MEM_freeN(str); | ||||
| } | } | ||||
| static void copymenu_logicbricks(SceneLayer *sl, Object *ob) | static void copymenu_logicbricks(ViewLayer *sl, Object *ob) | ||||
| { | { | ||||
| //XXX no longer used - to be removed - replaced by logicbricks_copy_exec | //XXX no longer used - to be removed - replaced by logicbricks_copy_exec | ||||
| Base *base; | Base *base; | ||||
| for (base = FIRSTBASE(sl); base; base = base->next) { | for (base = FIRSTBASE(sl); base; base = base->next) { | ||||
| if (base->object != ob) { | if (base->object != ob) { | ||||
| if (TESTBASELIB(base)) { | if (TESTBASELIB(base)) { | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | static void copy_texture_space(Object *to, Object *ob) | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_curve_texspace_calc(to->data); | BKE_curve_texspace_calc(to->data); | ||||
| } | } | ||||
| } | } | ||||
| /* UNUSED, keep in case we want to copy functionality for use elsewhere */ | /* UNUSED, keep in case we want to copy functionality for use elsewhere */ | ||||
| static void copy_attr(Main *bmain, Scene *scene, SceneLayer *sl, short event) | static void copy_attr(Main *bmain, Scene *scene, ViewLayer *sl, short event) | ||||
| { | { | ||||
| Object *ob; | Object *ob; | ||||
| Base *base; | Base *base; | ||||
| Curve *cu, *cu1; | Curve *cu, *cu1; | ||||
| Nurb *nu; | Nurb *nu; | ||||
| bool do_depgraph_update = false; | bool do_depgraph_update = false; | ||||
| if (ID_IS_LINKED(scene)) return; | if (ID_IS_LINKED(scene)) return; | ||||
| ▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | #endif // XXX old animation system | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (do_depgraph_update) | if (do_depgraph_update) | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, SceneLayer *sl) | static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLayer *sl) | ||||
| { | { | ||||
| Object *ob; | Object *ob; | ||||
| short event; | short event; | ||||
| char str[512]; | char str[512]; | ||||
| if (!(ob = OBACT(sl))) return; | if (!(ob = OBACT(sl))) return; | ||||
| if (scene->obedit) { /* XXX get from context */ | if (scene->obedit) { /* XXX get from context */ | ||||
| ▲ Show 20 Lines • Show All 407 Lines • ▼ Show 20 Lines | void OBJECT_OT_shade_smooth(wmOperatorType *ot) | ||||
| ot->exec = shade_smooth_exec; | ot->exec = shade_smooth_exec; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| /* ********************** */ | /* ********************** */ | ||||
| static void UNUSED_FUNCTION(image_aspect) (Scene *scene, SceneLayer *sl) | static void UNUSED_FUNCTION(image_aspect) (Scene *scene, ViewLayer *sl) | ||||
| { | { | ||||
| /* all selected objects with an image map: scale in image aspect */ | /* all selected objects with an image map: scale in image aspect */ | ||||
| Base *base; | Base *base; | ||||
| Object *ob; | Object *ob; | ||||
| Material *ma; | Material *ma; | ||||
| Tex *tex; | Tex *tex; | ||||
| float x, y, space; | float x, y, space; | ||||
| int a, b, done; | int a, b, done; | ||||
| ▲ Show 20 Lines • Show All 762 Lines • Show Last 20 Lines | |||||