Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_constraint.c
| Show First 20 Lines • Show All 1,687 Lines • ▼ Show 20 Lines | static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob, bPoseChannel **tar_pchan, bool add) | ||||
| if ((found == false) && (add)) { | if ((found == false) && (add)) { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Base *base = BASACT(view_layer), *newbase = NULL; | Base *base = BASACT(view_layer), *newbase = NULL; | ||||
| Object *obt; | Object *obt; | ||||
| /* add new target object */ | /* add new target object */ | ||||
| obt = BKE_object_add(bmain, scene, view_layer, OB_EMPTY, NULL); | obt = BKE_object_add(bmain, scene, view_layer, CTX_wm_workspace(C), OB_EMPTY, NULL); | ||||
| /* set layers OK */ | /* set layers OK */ | ||||
| newbase = BASACT(view_layer); | newbase = BASACT(view_layer); | ||||
| newbase->lay = base->lay; | newbase->lay = base->lay; | ||||
| obt->lay = newbase->lay; | obt->lay = newbase->lay; | ||||
| /* transform cent to global coords for loc */ | /* transform cent to global coords for loc */ | ||||
| if (pchanact) { | if (pchanact) { | ||||
| ▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines | |||||