Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_templates.c
| Show First 20 Lines • Show All 1,743 Lines • ▼ Show 20 Lines | static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v) | ||||
| ED_undo_push(C, "Modifier convert to real"); | ED_undo_push(C, "Modifier convert to real"); | ||||
| } | } | ||||
| static int modifier_can_delete(ModifierData *md) | static int modifier_can_delete(ModifierData *md) | ||||
| { | { | ||||
| /* fluid particle modifier can't be deleted here */ | /* fluid particle modifier can't be deleted here */ | ||||
| if (md->type == eModifierType_ParticleSystem) { | if (md->type == eModifierType_ParticleSystem) { | ||||
| if (((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID) { | if ( ((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID || | ||||
| ((ParticleSystemModifierData *)md)->psys->part->type == PART_MANTA_FLIP || | |||||
| ((ParticleSystemModifierData *)md)->psys->part->type == PART_MANTA_FOAM || | |||||
| ((ParticleSystemModifierData *)md)->psys->part->type == PART_MANTA_SPRAY || | |||||
| ((ParticleSystemModifierData *)md)->psys->part->type == PART_MANTA_BUBBLE || | |||||
| ((ParticleSystemModifierData *)md)->psys->part->type == PART_MANTA_BUBBLE) | |||||
| { | |||||
| return 0; | return 0; | ||||
sergey: Store `((ParticleSystemModifierData *)md)->psys->part->type` in a temporary variable. No need… | |||||
| } | } | ||||
| } | } | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| /* Check whether Modifier is a simulation or not, | /* Check whether Modifier is a simulation or not, | ||||
| * this is used for switching to the physics/particles context tab */ | * this is used for switching to the physics/particles context tab */ | ||||
| static int modifier_is_simulation(ModifierData *md) | static int modifier_is_simulation(ModifierData *md) | ||||
| { | { | ||||
| /* Physic Tab */ | /* Physic Tab */ | ||||
| if (ELEM(md->type, | if (ELEM(md->type, | ||||
| eModifierType_Cloth, | eModifierType_Cloth, | ||||
| eModifierType_Collision, | eModifierType_Collision, | ||||
| eModifierType_Fluidsim, | eModifierType_Fluidsim, | ||||
| eModifierType_Smoke, | eModifierType_Manta, | ||||
| eModifierType_Softbody, | eModifierType_Softbody, | ||||
| eModifierType_Surface, | eModifierType_Surface, | ||||
| eModifierType_DynamicPaint)) { | eModifierType_DynamicPaint)) { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| /* Particle Tab */ | /* Particle Tab */ | ||||
| else if (md->type == eModifierType_ParticleSystem) { | else if (md->type == eModifierType_ParticleSystem) { | ||||
| return 2; | return 2; | ||||
| ▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | if (!ELEM(md->type, eModifierType_Collision, eModifierType_Surface)) { | ||||
| UI_block_lock_clear(block); | UI_block_lock_clear(block); | ||||
| UI_block_lock_set(block, ob && ID_IS_LINKED(ob), ERROR_LIBDATA_MESSAGE); | UI_block_lock_set(block, ob && ID_IS_LINKED(ob), ERROR_LIBDATA_MESSAGE); | ||||
| if (!ELEM(md->type, | if (!ELEM(md->type, | ||||
| eModifierType_Fluidsim, | eModifierType_Fluidsim, | ||||
| eModifierType_Softbody, | eModifierType_Softbody, | ||||
| eModifierType_ParticleSystem, | eModifierType_ParticleSystem, | ||||
| eModifierType_Cloth, | eModifierType_Cloth, | ||||
| eModifierType_Smoke)) { | eModifierType_Manta)) { | ||||
| uiItemO(row, | uiItemO(row, | ||||
| CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), | CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), | ||||
| ICON_NONE, | ICON_NONE, | ||||
| "OBJECT_OT_modifier_copy"); | "OBJECT_OT_modifier_copy"); | ||||
| } | } | ||||
| } | } | ||||
| /* result is the layout block inside the box, | /* result is the layout block inside the box, | ||||
| ▲ Show 20 Lines • Show All 4,768 Lines • Show Last 20 Lines | |||||
Store ((ParticleSystemModifierData *)md)->psys->part->type in a temporary variable. No need to copy-paste it in all the lines.