Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_edit.c
| Show First 20 Lines • Show All 767 Lines • ▼ Show 20 Lines | if (base->object != ob) { | ||||
| free_sensors(&base->object->sensors); | free_sensors(&base->object->sensors); | ||||
| unlink_controllers(&base->object->controllers); | unlink_controllers(&base->object->controllers); | ||||
| free_controllers(&base->object->controllers); | free_controllers(&base->object->controllers); | ||||
| unlink_actuators(&base->object->actuators); | unlink_actuators(&base->object->actuators); | ||||
| free_actuators(&base->object->actuators); | free_actuators(&base->object->actuators); | ||||
| /* now copy it, this also works without logicbricks! */ | /* now copy it, this also works without logicbricks! */ | ||||
| clear_sca_new_poins_ob(ob); | clear_sca_new_poins_ob(ob); | ||||
| copy_sensors(&base->object->sensors, &ob->sensors); | copy_sensors(&base->object->sensors, &ob->sensors, 0); | ||||
| copy_controllers(&base->object->controllers, &ob->controllers); | copy_controllers(&base->object->controllers, &ob->controllers, 0); | ||||
| copy_actuators(&base->object->actuators, &ob->actuators); | copy_actuators(&base->object->actuators, &ob->actuators, 0); | ||||
| set_sca_new_poins_ob(base->object); | set_sca_new_poins_ob(base->object); | ||||
| /* some menu settings */ | /* some menu settings */ | ||||
| base->object->scavisflag = ob->scavisflag; | base->object->scavisflag = ob->scavisflag; | ||||
| base->object->scaflag = ob->scaflag; | base->object->scaflag = ob->scaflag; | ||||
| /* set the initial state */ | /* set the initial state */ | ||||
| base->object->state = ob->state; | base->object->state = ob->state; | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | if (base != BASACT) { | ||||
| base->object->min_vel = ob->min_vel; | base->object->min_vel = ob->min_vel; | ||||
| base->object->max_vel = ob->max_vel; | base->object->max_vel = ob->max_vel; | ||||
| base->object->min_angvel = ob->min_angvel; | base->object->min_angvel = ob->min_angvel; | ||||
| base->object->max_angvel = ob->max_angvel; | base->object->max_angvel = ob->max_angvel; | ||||
| if (ob->gameflag & OB_BOUNDS) { | if (ob->gameflag & OB_BOUNDS) { | ||||
| base->object->collision_boundtype = ob->collision_boundtype; | base->object->collision_boundtype = ob->collision_boundtype; | ||||
| } | } | ||||
| base->object->margin = ob->margin; | base->object->margin = ob->margin; | ||||
| base->object->bsoft = copy_bulletsoftbody(ob->bsoft); | base->object->bsoft = copy_bulletsoftbody(ob->bsoft, 0); | ||||
| } | } | ||||
| else if (event == 17) { /* tex space */ | else if (event == 17) { /* tex space */ | ||||
| copy_texture_space(base->object, ob); | copy_texture_space(base->object, ob); | ||||
| } | } | ||||
| else if (event == 18) { /* font settings */ | else if (event == 18) { /* font settings */ | ||||
| if (base->object->type == ob->type) { | if (base->object->type == ob->type) { | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | if (base != BASACT) { | ||||
| BKE_constraints_copy(&base->object->constraints, &ob->constraints, true); | BKE_constraints_copy(&base->object->constraints, &ob->constraints, true); | ||||
| do_depgraph_update = true; | do_depgraph_update = true; | ||||
| } | } | ||||
| else if (event == 23) { | else if (event == 23) { | ||||
| base->object->softflag = ob->softflag; | base->object->softflag = ob->softflag; | ||||
| if (base->object->soft) sbFree(base->object->soft); | if (base->object->soft) sbFree(base->object->soft); | ||||
| base->object->soft = copy_softbody(ob->soft, false); | base->object->soft = copy_softbody(ob->soft, 0); | ||||
| if (!modifiers_findByType(base->object, eModifierType_Softbody)) { | if (!modifiers_findByType(base->object, eModifierType_Softbody)) { | ||||
| BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody)); | BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody)); | ||||
| } | } | ||||
| } | } | ||||
| else if (event == 26) { | else if (event == 26) { | ||||
| #if 0 // XXX old animation system | #if 0 // XXX old animation system | ||||
| copy_nlastrips(&base->object->nlastrips, &ob->nlastrips); | copy_nlastrips(&base->object->nlastrips, &ob->nlastrips); | ||||
| ▲ Show 20 Lines • Show All 1,047 Lines • ▼ Show 20 Lines | if (ob != ob_iter) { | ||||
| free_sensors(&ob_iter->sensors); | free_sensors(&ob_iter->sensors); | ||||
| unlink_controllers(&ob_iter->controllers); | unlink_controllers(&ob_iter->controllers); | ||||
| free_controllers(&ob_iter->controllers); | free_controllers(&ob_iter->controllers); | ||||
| unlink_actuators(&ob_iter->actuators); | unlink_actuators(&ob_iter->actuators); | ||||
| free_actuators(&ob_iter->actuators); | free_actuators(&ob_iter->actuators); | ||||
| /* now copy it, this also works without logicbricks! */ | /* now copy it, this also works without logicbricks! */ | ||||
| clear_sca_new_poins_ob(ob); | clear_sca_new_poins_ob(ob); | ||||
| copy_sensors(&ob_iter->sensors, &ob->sensors); | copy_sensors(&ob_iter->sensors, &ob->sensors, 0); | ||||
| copy_controllers(&ob_iter->controllers, &ob->controllers); | copy_controllers(&ob_iter->controllers, &ob->controllers, 0); | ||||
| copy_actuators(&ob_iter->actuators, &ob->actuators); | copy_actuators(&ob_iter->actuators, &ob->actuators, 0); | ||||
| set_sca_new_poins_ob(ob_iter); | set_sca_new_poins_ob(ob_iter); | ||||
| /* some menu settings */ | /* some menu settings */ | ||||
| ob_iter->scavisflag = ob->scavisflag; | ob_iter->scavisflag = ob->scavisflag; | ||||
| ob_iter->scaflag = ob->scaflag; | ob_iter->scaflag = ob->scaflag; | ||||
| /* set the initial state */ | /* set the initial state */ | ||||
| ob_iter->state = ob->state; | ob_iter->state = ob->state; | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (ob != ob_iter) { | ||||
| ob_iter->max_vel = ob->max_vel; | ob_iter->max_vel = ob->max_vel; | ||||
| ob_iter->min_angvel = ob->min_angvel; | ob_iter->min_angvel = ob->min_angvel; | ||||
| ob_iter->max_angvel = ob->max_angvel; | ob_iter->max_angvel = ob->max_angvel; | ||||
| ob_iter->obstacleRad = ob->obstacleRad; | ob_iter->obstacleRad = ob->obstacleRad; | ||||
| ob_iter->mass = ob->mass; | ob_iter->mass = ob->mass; | ||||
| copy_v3_v3(ob_iter->anisotropicFriction, ob->anisotropicFriction); | copy_v3_v3(ob_iter->anisotropicFriction, ob->anisotropicFriction); | ||||
| ob_iter->collision_boundtype = ob->collision_boundtype; | ob_iter->collision_boundtype = ob->collision_boundtype; | ||||
| ob_iter->margin = ob->margin; | ob_iter->margin = ob->margin; | ||||
| ob_iter->bsoft = copy_bulletsoftbody(ob->bsoft); | ob_iter->bsoft = copy_bulletsoftbody(ob->bsoft, 0); | ||||
| if (ob->restrictflag & OB_RESTRICT_RENDER) | if (ob->restrictflag & OB_RESTRICT_RENDER) | ||||
| ob_iter->restrictflag |= OB_RESTRICT_RENDER; | ob_iter->restrictflag |= OB_RESTRICT_RENDER; | ||||
| else | else | ||||
| ob_iter->restrictflag &= ~OB_RESTRICT_RENDER; | ob_iter->restrictflag &= ~OB_RESTRICT_RENDER; | ||||
| ob_iter->col_group = ob->col_group; | ob_iter->col_group = ob->col_group; | ||||
| ob_iter->col_mask = ob->col_mask; | ob_iter->col_mask = ob->col_mask; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines | |||||