Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_constraint.c
| Show First 20 Lines • Show All 1,676 Lines • ▼ Show 20 Lines | if (found == false) { | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| } | } | ||||
| /* if still not found, add a new empty to act as a target (if allowed) */ | /* if still not found, add a new empty to act as a target (if allowed) */ | ||||
| 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); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | |||||
| Base *base = BASACT, *newbase = NULL; | Base *base = BASACT, *newbase = NULL; | ||||
| Object *obt; | Object *obt; | ||||
| /* add new target object */ | /* add new target object */ | ||||
| obt = BKE_object_add(bmain, scene, OB_EMPTY, NULL); | obt = BKE_object_add(bmain, scene, sl, OB_EMPTY, NULL); | ||||
| /* set layers OK */ | /* set layers OK */ | ||||
| newbase = BASACT; | newbase = BASACT; | ||||
| 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 | |||||