Removed all direct uses of BKE_particle.h and DNA_particle_types.h from source/blender/editors.
This commit is contained in:
parent
cc468c1974
commit
29a792a75b
|
@ -68,7 +68,7 @@ extern void sbObjectToSoftbody(struct Object *ob);
|
|||
/* pass NULL to unlink again */
|
||||
extern void sbSetInterruptCallBack(int (*f)(void));
|
||||
|
||||
extern void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]);
|
||||
extern void SB_estimate_transform(struct Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "DNA_armature_types.h"
|
||||
#include "DNA_camera_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
|
@ -1909,7 +1908,7 @@ static int acf_dspart_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settin
|
|||
|
||||
switch (setting) {
|
||||
case ACHANNEL_SETTING_EXPAND: /* expanded */
|
||||
return PART_DS_EXPAND;
|
||||
return 0;
|
||||
|
||||
case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
|
||||
return ADT_NLA_EVAL_OFF;
|
||||
|
@ -1927,22 +1926,18 @@ static int acf_dspart_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settin
|
|||
}
|
||||
|
||||
/* get pointer to the setting */
|
||||
static void *acf_dspart_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
|
||||
static void *acf_dspart_setting_ptr(bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting, short *type)
|
||||
{
|
||||
ParticleSettings *part = (ParticleSettings *)ale->data;
|
||||
|
||||
/* clear extra return data first */
|
||||
*type = 0;
|
||||
|
||||
switch (setting) {
|
||||
case ACHANNEL_SETTING_EXPAND: /* expanded */
|
||||
return GET_ACF_FLAG_PTR(part->flag, type);
|
||||
return NULL;
|
||||
|
||||
case ACHANNEL_SETTING_SELECT: /* selected */
|
||||
case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
|
||||
case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
|
||||
if (part->adt)
|
||||
return GET_ACF_FLAG_PTR(part->adt->flag, type);
|
||||
return NULL;
|
||||
|
||||
default: /* unsupported */
|
||||
|
|
|
@ -123,7 +123,6 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datat
|
|||
case ANIMTYPE_DSCUR:
|
||||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
@ -178,7 +177,6 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datat
|
|||
case ANIMTYPE_DSCUR:
|
||||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
@ -278,7 +276,6 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d
|
|||
case ANIMTYPE_DSCUR:
|
||||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
@ -373,7 +370,6 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d
|
|||
case ANIMTYPE_DSCUR:
|
||||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
@ -2715,7 +2711,6 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
|
|||
case ANIMTYPE_DSCUR:
|
||||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meta_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
#include "DNA_sequence_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
@ -752,19 +751,6 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
|
|||
ale->adt = BKE_animdata_from_id(data);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSPART:
|
||||
{
|
||||
ParticleSettings *part = (ParticleSettings *)ale->data;
|
||||
AnimData *adt = part->adt;
|
||||
|
||||
ale->flag = FILTER_PART_OBJD(part);
|
||||
|
||||
ale->key_data = (adt) ? adt->action : NULL;
|
||||
ale->datatype = ALE_ACT;
|
||||
|
||||
ale->adt = BKE_animdata_from_id(data);
|
||||
break;
|
||||
}
|
||||
case ANIMTYPE_DSTEX:
|
||||
{
|
||||
Tex *tex = (Tex *)data;
|
||||
|
@ -1985,12 +1971,6 @@ static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data,
|
|||
mtex = (MTex **)(&wo->mtex);
|
||||
break;
|
||||
}
|
||||
case ID_PA:
|
||||
{
|
||||
ParticleSettings *part = (ParticleSettings *)owner_id;
|
||||
mtex = (MTex **)(&part->mtex);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
/* invalid/unsupported option */
|
||||
|
@ -2186,53 +2166,6 @@ static size_t animdata_filter_ds_modifiers(bAnimContext *ac, ListBase *anim_data
|
|||
/* ............ */
|
||||
|
||||
|
||||
static size_t animdata_filter_ds_particles(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
|
||||
{
|
||||
ParticleSystem *psys;
|
||||
size_t items = 0;
|
||||
|
||||
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
|
||||
ListBase tmp_data = {NULL, NULL};
|
||||
size_t tmp_items = 0;
|
||||
|
||||
/* if no material returned, skip - so that we don't get weird blank entries... */
|
||||
if (ELEM(NULL, psys->part, psys->part->adt))
|
||||
continue;
|
||||
|
||||
/* add particle-system's animation data to temp collection */
|
||||
BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_PART_OBJD(psys->part))
|
||||
{
|
||||
/* particle system's animation data */
|
||||
tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)psys->part, filter_mode);
|
||||
|
||||
/* textures */
|
||||
if (!(ads->filterflag & ADS_FILTER_NOTEX))
|
||||
tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, (ID *)psys->part, filter_mode);
|
||||
}
|
||||
END_ANIMFILTER_SUBCHANNELS;
|
||||
|
||||
/* did we find anything? */
|
||||
if (tmp_items) {
|
||||
/* include particle-expand widget first */
|
||||
if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
|
||||
/* check if filtering by active status */
|
||||
if (ANIMCHANNEL_ACTIVEOK(psys->part)) {
|
||||
ANIMCHANNEL_NEW_CHANNEL(psys->part, ANIMTYPE_DSPART, psys->part);
|
||||
}
|
||||
}
|
||||
|
||||
/* now add the list of collected channels */
|
||||
BLI_movelisttolist(anim_data, &tmp_data);
|
||||
BLI_assert(BLI_listbase_is_empty(&tmp_data));
|
||||
items += tmp_items;
|
||||
}
|
||||
}
|
||||
|
||||
/* return the number of items added to the list */
|
||||
return items;
|
||||
}
|
||||
|
||||
|
||||
static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
|
||||
{
|
||||
ListBase tmp_data = {NULL, NULL};
|
||||
|
@ -2508,11 +2441,6 @@ static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, ListBase *anim_data
|
|||
tmp_items += animdata_filter_ds_obdata(ac, &tmp_data, ads, ob, filter_mode);
|
||||
}
|
||||
|
||||
/* particles */
|
||||
if ((ob->particlesystem.first) && !(ads->filterflag & ADS_FILTER_NOPART)) {
|
||||
tmp_items += animdata_filter_ds_particles(ac, &tmp_data, ads, ob, filter_mode);
|
||||
}
|
||||
|
||||
/* grease pencil */
|
||||
if ((ob->gpd) && !(ads->filterflag & ADS_FILTER_NOGPENCIL)) {
|
||||
tmp_items += animdata_filter_ds_gpencil(ac, &tmp_data, ads, ob->gpd, filter_mode);
|
||||
|
|
|
@ -157,7 +157,6 @@ typedef enum eAnim_ChannelType {
|
|||
ANIMTYPE_DSSKEY,
|
||||
ANIMTYPE_DSWOR,
|
||||
ANIMTYPE_DSNTREE,
|
||||
ANIMTYPE_DSPART,
|
||||
ANIMTYPE_DSMBALL,
|
||||
ANIMTYPE_DSARM,
|
||||
ANIMTYPE_DSMESH,
|
||||
|
|
|
@ -190,8 +190,6 @@ bool ED_object_modifier_remove(struct ReportList *reports, struct Main *bmain,
|
|||
void ED_object_modifier_clear(struct Main *bmain, struct Object *ob);
|
||||
int ED_object_modifier_move_down(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
||||
int ED_object_modifier_move_up(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
||||
int ED_object_modifier_convert(struct ReportList *reports, struct Main *bmain, struct Scene *scene,
|
||||
struct Object *ob, struct ModifierData *md);
|
||||
int ED_object_modifier_apply(struct ReportList *reports, struct Scene *scene,
|
||||
struct Object *ob, struct ModifierData *md, int mode);
|
||||
int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struct ModifierData *md);
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
#include "BKE_modifier.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_packedFile.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_sca.h"
|
||||
|
@ -784,16 +783,6 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
|
|||
ED_undo_push(C, "Modifier convert to real");
|
||||
}
|
||||
|
||||
static int modifier_can_delete(ModifierData *md)
|
||||
{
|
||||
/* fluid particle modifier can't be deleted here */
|
||||
if (md->type == eModifierType_ParticleSystem)
|
||||
if (((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Check whether Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
|
||||
static int modifier_is_simulation(ModifierData *md)
|
||||
{
|
||||
|
@ -921,9 +910,8 @@ static uiLayout *draw_modifier(
|
|||
|
||||
UI_block_emboss_set(block, UI_EMBOSS_NONE);
|
||||
/* When Modifier is a simulation, show button to switch to context rather than the delete button. */
|
||||
if (modifier_can_delete(md) &&
|
||||
(!modifier_is_simulation(md) ||
|
||||
STREQ(scene->r.engine, RE_engine_id_BLENDER_GAME)))
|
||||
if (!modifier_is_simulation(md) ||
|
||||
STREQ(scene->r.engine, RE_engine_id_BLENDER_GAME))
|
||||
{
|
||||
uiItemO(row, "", ICON_X, "OBJECT_OT_modifier_remove");
|
||||
}
|
||||
|
@ -947,28 +935,14 @@ static uiLayout *draw_modifier(
|
|||
/* only here obdata, the rest of modifiers is ob level */
|
||||
UI_block_lock_set(block, BKE_object_obdata_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
|
||||
|
||||
if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystem *psys = ((ParticleSystemModifierData *)md)->psys;
|
||||
|
||||
if (!(ob->mode & OB_MODE_PARTICLE_EDIT)) {
|
||||
if (ELEM(psys->part->ren_as, PART_DRAW_GR, PART_DRAW_OB))
|
||||
uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE,
|
||||
"OBJECT_OT_duplicates_make_real");
|
||||
else if (psys->part->ren_as == PART_DRAW_PATH && psys->pathcache)
|
||||
uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Convert"), ICON_NONE,
|
||||
"OBJECT_OT_modifier_convert");
|
||||
}
|
||||
}
|
||||
else {
|
||||
uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
|
||||
uiItemEnumO(row, "OBJECT_OT_modifier_apply", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"),
|
||||
0, "apply_as", MODIFIER_APPLY_DATA);
|
||||
|
||||
if (modifier_isSameTopology(md) && !modifier_isNonGeometrical(md)) {
|
||||
uiItemEnumO(row, "OBJECT_OT_modifier_apply",
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"),
|
||||
0, "apply_as", MODIFIER_APPLY_SHAPE);
|
||||
}
|
||||
uiLayoutSetOperatorContext(row, WM_OP_INVOKE_DEFAULT);
|
||||
uiItemEnumO(row, "OBJECT_OT_modifier_apply", CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply"),
|
||||
0, "apply_as", MODIFIER_APPLY_DATA);
|
||||
|
||||
if (modifier_isSameTopology(md) && !modifier_isNonGeometrical(md)) {
|
||||
uiItemEnumO(row, "OBJECT_OT_modifier_apply",
|
||||
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Apply as Shape Key"),
|
||||
0, "apply_as", MODIFIER_APPLY_SHAPE);
|
||||
}
|
||||
|
||||
UI_block_lock_clear(block);
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
#include "BKE_mesh.h"
|
||||
#include "BKE_nla.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_sca.h"
|
||||
#include "BKE_scene.h"
|
||||
|
@ -1924,23 +1923,6 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
|
|||
}
|
||||
}
|
||||
}
|
||||
if (dupflag & USER_DUP_PSYS) {
|
||||
ParticleSystem *psys;
|
||||
for (psys = obn->particlesystem.first; psys; psys = psys->next) {
|
||||
id = (ID *) psys->part;
|
||||
if (id) {
|
||||
ID_NEW_US(psys->part)
|
||||
else
|
||||
psys->part = BKE_particlesettings_copy(psys->part);
|
||||
|
||||
if (dupflag & USER_DUP_ACT) {
|
||||
BKE_animdata_copy_id_action(&psys->part->id);
|
||||
}
|
||||
|
||||
id_us_min(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
id = obn->data;
|
||||
didit = 0;
|
||||
|
|
|
@ -169,7 +169,6 @@ void OBJECT_OT_modifier_remove(struct wmOperatorType *ot);
|
|||
void OBJECT_OT_modifier_move_up(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_modifier_move_down(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_modifier_apply(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_modifier_convert(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_modifier_copy(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_multires_reshape(struct wmOperatorType *ot);
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_object_force.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "BLI_bitmap.h"
|
||||
|
@ -71,7 +72,6 @@
|
|||
#include "BKE_object_deform.h"
|
||||
#include "BKE_ocean.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_softbody.h"
|
||||
#include "BKE_editmesh.h"
|
||||
|
||||
|
@ -111,65 +111,57 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
|
|||
}
|
||||
}
|
||||
|
||||
if (type == eModifierType_ParticleSystem) {
|
||||
/* don't need to worry about the new modifier's name, since that is set to the number
|
||||
* of particle systems which shouldn't have too many duplicates
|
||||
*/
|
||||
new_md = object_add_particle_system(scene, ob, name);
|
||||
/* get new modifier data to add */
|
||||
new_md = modifier_new(type);
|
||||
|
||||
if (mti->flags & eModifierTypeFlag_RequiresOriginalData) {
|
||||
md = ob->modifiers.first;
|
||||
|
||||
while (md && modifierType_getInfo(md->type)->type == eModifierTypeType_OnlyDeform)
|
||||
md = md->next;
|
||||
|
||||
BLI_insertlinkbefore(&ob->modifiers, md, new_md);
|
||||
}
|
||||
else {
|
||||
/* get new modifier data to add */
|
||||
new_md = modifier_new(type);
|
||||
else
|
||||
BLI_addtail(&ob->modifiers, new_md);
|
||||
|
||||
if (name) {
|
||||
BLI_strncpy_utf8(new_md->name, name, sizeof(new_md->name));
|
||||
}
|
||||
|
||||
/* make sure modifier data has unique name */
|
||||
|
||||
modifier_unique_name(&ob->modifiers, new_md);
|
||||
|
||||
/* special cases */
|
||||
if (type == eModifierType_Softbody) {
|
||||
if (!ob->soft) {
|
||||
ob->soft = sbNew(scene);
|
||||
ob->softflag |= OB_SB_GOAL | OB_SB_EDGES;
|
||||
}
|
||||
}
|
||||
else if (type == eModifierType_Collision) {
|
||||
if (!ob->pd)
|
||||
ob->pd = object_add_collision_fields(0);
|
||||
|
||||
if (mti->flags & eModifierTypeFlag_RequiresOriginalData) {
|
||||
md = ob->modifiers.first;
|
||||
|
||||
while (md && modifierType_getInfo(md->type)->type == eModifierTypeType_OnlyDeform)
|
||||
md = md->next;
|
||||
|
||||
BLI_insertlinkbefore(&ob->modifiers, md, new_md);
|
||||
}
|
||||
else
|
||||
BLI_addtail(&ob->modifiers, new_md);
|
||||
ob->pd->deflect = 1;
|
||||
}
|
||||
else if (type == eModifierType_Surface) {
|
||||
/* pass */
|
||||
}
|
||||
else if (type == eModifierType_Multires) {
|
||||
/* set totlvl from existing MDISPS layer if object already had it */
|
||||
multiresModifier_set_levels_from_disps((MultiresModifierData *)new_md, ob);
|
||||
|
||||
if (name) {
|
||||
BLI_strncpy_utf8(new_md->name, name, sizeof(new_md->name));
|
||||
}
|
||||
|
||||
/* make sure modifier data has unique name */
|
||||
|
||||
modifier_unique_name(&ob->modifiers, new_md);
|
||||
|
||||
/* special cases */
|
||||
if (type == eModifierType_Softbody) {
|
||||
if (!ob->soft) {
|
||||
ob->soft = sbNew(scene);
|
||||
ob->softflag |= OB_SB_GOAL | OB_SB_EDGES;
|
||||
}
|
||||
}
|
||||
else if (type == eModifierType_Collision) {
|
||||
if (!ob->pd)
|
||||
ob->pd = object_add_collision_fields(0);
|
||||
|
||||
ob->pd->deflect = 1;
|
||||
}
|
||||
else if (type == eModifierType_Surface) {
|
||||
/* pass */
|
||||
}
|
||||
else if (type == eModifierType_Multires) {
|
||||
/* set totlvl from existing MDISPS layer if object already had it */
|
||||
multiresModifier_set_levels_from_disps((MultiresModifierData *)new_md, ob);
|
||||
|
||||
if (ob->mode & OB_MODE_SCULPT) {
|
||||
/* ensure that grid paint mask layer is created */
|
||||
BKE_sculpt_mask_layers_ensure(ob, (MultiresModifierData *)new_md);
|
||||
}
|
||||
}
|
||||
else if (type == eModifierType_Skin) {
|
||||
/* ensure skin-node customdata exists */
|
||||
BKE_mesh_ensure_skin_customdata(ob->data);
|
||||
if (ob->mode & OB_MODE_SCULPT) {
|
||||
/* ensure that grid paint mask layer is created */
|
||||
BKE_sculpt_mask_layers_ensure(ob, (MultiresModifierData *)new_md);
|
||||
}
|
||||
}
|
||||
else if (type == eModifierType_Skin) {
|
||||
/* ensure skin-node customdata exists */
|
||||
BKE_mesh_ensure_skin_customdata(ob->data);
|
||||
}
|
||||
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
DAG_relations_tag_update(bmain);
|
||||
|
@ -280,14 +272,7 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md,
|
|||
}
|
||||
|
||||
/* special cases */
|
||||
if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md;
|
||||
|
||||
BLI_remlink(&ob->particlesystem, psmd->psys);
|
||||
psys_free(ob, psmd->psys);
|
||||
psmd->psys = NULL;
|
||||
}
|
||||
else if (md->type == eModifierType_Softbody) {
|
||||
if (md->type == eModifierType_Softbody) {
|
||||
if (ob->soft) {
|
||||
sbFree(ob->soft);
|
||||
ob->soft = NULL;
|
||||
|
@ -411,115 +396,6 @@ int ED_object_modifier_move_down(ReportList *reports, Object *ob, ModifierData *
|
|||
return 1;
|
||||
}
|
||||
|
||||
int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *scene, Object *ob, ModifierData *md)
|
||||
{
|
||||
Object *obn;
|
||||
ParticleSystem *psys;
|
||||
ParticleCacheKey *key, **cache;
|
||||
ParticleSettings *part;
|
||||
Mesh *me;
|
||||
MVert *mvert;
|
||||
MEdge *medge;
|
||||
int a, k, kmax;
|
||||
int totvert = 0, totedge = 0, cvert = 0;
|
||||
int totpart = 0, totchild = 0;
|
||||
|
||||
if (md->type != eModifierType_ParticleSystem) return 0;
|
||||
if (ob && ob->mode & OB_MODE_PARTICLE_EDIT) return 0;
|
||||
|
||||
psys = ((ParticleSystemModifierData *)md)->psys;
|
||||
part = psys->part;
|
||||
|
||||
if (part->ren_as != PART_DRAW_PATH || psys->pathcache == NULL)
|
||||
return 0;
|
||||
|
||||
totpart = psys->totcached;
|
||||
totchild = psys->totchildcache;
|
||||
|
||||
if (totchild && (part->draw & PART_DRAW_PARENT) == 0)
|
||||
totpart = 0;
|
||||
|
||||
/* count */
|
||||
cache = psys->pathcache;
|
||||
for (a = 0; a < totpart; a++) {
|
||||
key = cache[a];
|
||||
|
||||
if (key->segments > 0) {
|
||||
totvert += key->segments + 1;
|
||||
totedge += key->segments;
|
||||
}
|
||||
}
|
||||
|
||||
cache = psys->childcache;
|
||||
for (a = 0; a < totchild; a++) {
|
||||
key = cache[a];
|
||||
|
||||
if (key->segments > 0) {
|
||||
totvert += key->segments + 1;
|
||||
totedge += key->segments;
|
||||
}
|
||||
}
|
||||
|
||||
if (totvert == 0) return 0;
|
||||
|
||||
/* add new mesh */
|
||||
obn = BKE_object_add(bmain, scene, OB_MESH, NULL);
|
||||
me = obn->data;
|
||||
|
||||
me->totvert = totvert;
|
||||
me->totedge = totedge;
|
||||
|
||||
me->mvert = CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, totvert);
|
||||
me->medge = CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, totedge);
|
||||
me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, 0);
|
||||
|
||||
mvert = me->mvert;
|
||||
medge = me->medge;
|
||||
|
||||
/* copy coordinates */
|
||||
cache = psys->pathcache;
|
||||
for (a = 0; a < totpart; a++) {
|
||||
key = cache[a];
|
||||
kmax = key->segments;
|
||||
for (k = 0; k <= kmax; k++, key++, cvert++, mvert++) {
|
||||
copy_v3_v3(mvert->co, key->co);
|
||||
if (k) {
|
||||
medge->v1 = cvert - 1;
|
||||
medge->v2 = cvert;
|
||||
medge->flag = ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE;
|
||||
medge++;
|
||||
}
|
||||
else {
|
||||
/* cheap trick to select the roots */
|
||||
mvert->flag |= SELECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cache = psys->childcache;
|
||||
for (a = 0; a < totchild; a++) {
|
||||
key = cache[a];
|
||||
kmax = key->segments;
|
||||
for (k = 0; k <= kmax; k++, key++, cvert++, mvert++) {
|
||||
copy_v3_v3(mvert->co, key->co);
|
||||
if (k) {
|
||||
medge->v1 = cvert - 1;
|
||||
medge->v2 = cvert;
|
||||
medge->flag = ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE;
|
||||
medge++;
|
||||
}
|
||||
else {
|
||||
/* cheap trick to select the roots */
|
||||
mvert->flag |= SELECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DAG_relations_tag_update(bmain);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, ModifierData *md)
|
||||
{
|
||||
const ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||
|
@ -650,20 +526,6 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* lattice modifier can be applied to particle system too */
|
||||
if (ob->particlesystem.first) {
|
||||
|
||||
ParticleSystem *psys = ob->particlesystem.first;
|
||||
|
||||
for (; psys; psys = psys->next) {
|
||||
|
||||
if (psys->part->type != PART_HAIR)
|
||||
continue;
|
||||
|
||||
psys_apply_hair_lattice(scene, ob, psys);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1042,47 +904,6 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot)
|
|||
edit_modifier_properties(ot);
|
||||
}
|
||||
|
||||
/************************ convert modifier operator *********************/
|
||||
|
||||
static int modifier_convert_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = ED_object_active_context(C);
|
||||
ModifierData *md = edit_modifier_property_get(op, ob, 0);
|
||||
|
||||
if (!md || !ED_object_modifier_convert(op->reports, bmain, scene, ob, md))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
|
||||
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static int modifier_convert_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
{
|
||||
if (edit_modifier_invoke_properties(C, op))
|
||||
return modifier_convert_exec(C, op);
|
||||
else
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
void OBJECT_OT_modifier_convert(wmOperatorType *ot)
|
||||
{
|
||||
ot->name = "Convert Modifier";
|
||||
ot->description = "Convert particles to a mesh object";
|
||||
ot->idname = "OBJECT_OT_modifier_convert";
|
||||
|
||||
ot->invoke = modifier_convert_invoke;
|
||||
ot->exec = modifier_convert_exec;
|
||||
ot->poll = edit_modifier_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
|
||||
edit_modifier_properties(ot);
|
||||
}
|
||||
|
||||
/************************ copy modifier operator *********************/
|
||||
|
||||
static int modifier_copy_exec(bContext *C, wmOperator *op)
|
||||
|
|
|
@ -133,7 +133,6 @@ void ED_operatortypes_object(void)
|
|||
WM_operatortype_append(OBJECT_OT_modifier_move_up);
|
||||
WM_operatortype_append(OBJECT_OT_modifier_move_down);
|
||||
WM_operatortype_append(OBJECT_OT_modifier_apply);
|
||||
WM_operatortype_append(OBJECT_OT_modifier_convert);
|
||||
WM_operatortype_append(OBJECT_OT_modifier_copy);
|
||||
WM_operatortype_append(OBJECT_OT_multires_subdivide);
|
||||
WM_operatortype_append(OBJECT_OT_multires_reshape);
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "DNA_lattice_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_meta_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
@ -2206,7 +2205,6 @@ static int make_local_exec(bContext *C, wmOperator *op)
|
|||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
AnimData *adt;
|
||||
ParticleSystem *psys;
|
||||
Material *ma, ***matarar;
|
||||
Lamp *la;
|
||||
ID *id;
|
||||
|
@ -2274,9 +2272,6 @@ static int make_local_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
}
|
||||
|
||||
for (psys = ob->particlesystem.first; psys; psys = psys->next)
|
||||
id_make_local(&psys->part->id, false);
|
||||
|
||||
adt = BKE_animdata_from_id(&ob->id);
|
||||
if (adt) BKE_animdata_make_local(adt);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "DNA_group_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_property_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_armature_types.h"
|
||||
|
@ -53,7 +54,6 @@
|
|||
#include "BKE_group.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_property.h"
|
||||
#include "BKE_report.h"
|
||||
#include "BKE_scene.h"
|
||||
|
@ -192,7 +192,6 @@ enum {
|
|||
OBJECT_SELECT_LINKED_MATERIAL,
|
||||
OBJECT_SELECT_LINKED_TEXTURE,
|
||||
OBJECT_SELECT_LINKED_DUPGROUP,
|
||||
OBJECT_SELECT_LINKED_PARTICLE,
|
||||
OBJECT_SELECT_LINKED_LIBRARY,
|
||||
OBJECT_SELECT_LINKED_LIBRARY_OBDATA
|
||||
};
|
||||
|
@ -203,7 +202,6 @@ static EnumPropertyItem prop_select_linked_types[] = {
|
|||
{OBJECT_SELECT_LINKED_MATERIAL, "MATERIAL", 0, "Material", ""},
|
||||
{OBJECT_SELECT_LINKED_TEXTURE, "TEXTURE", 0, "Texture", ""},
|
||||
{OBJECT_SELECT_LINKED_DUPGROUP, "DUPGROUP", 0, "Dupligroup", ""},
|
||||
{OBJECT_SELECT_LINKED_PARTICLE, "PARTICLE", 0, "Particle System", ""},
|
||||
{OBJECT_SELECT_LINKED_LIBRARY, "LIBRARY", 0, "Library", ""},
|
||||
{OBJECT_SELECT_LINKED_LIBRARY_OBDATA, "LIBRARY_OBDATA", 0, "Library (Object Data)", ""},
|
||||
{0, NULL, 0, NULL, NULL}
|
||||
|
@ -313,37 +311,6 @@ static bool object_select_all_by_dup_group(bContext *C, Object *ob)
|
|||
return changed;
|
||||
}
|
||||
|
||||
static bool object_select_all_by_particle(bContext *C, Object *ob)
|
||||
{
|
||||
ParticleSystem *psys_act = psys_get_current(ob);
|
||||
bool changed = false;
|
||||
|
||||
CTX_DATA_BEGIN (C, Base *, base, visible_bases)
|
||||
{
|
||||
if ((base->flag & SELECT) == 0) {
|
||||
/* loop through other particles*/
|
||||
ParticleSystem *psys;
|
||||
|
||||
for (psys = base->object->particlesystem.first; psys; psys = psys->next) {
|
||||
if (psys->part == psys_act->part) {
|
||||
base->flag |= SELECT;
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (base->flag & SELECT) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
base->object->flag = base->flag;
|
||||
}
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
static bool object_select_all_by_library(bContext *C, Library *lib)
|
||||
{
|
||||
bool changed = false;
|
||||
|
@ -461,12 +428,6 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
|
|||
|
||||
changed = object_select_all_by_dup_group(C, ob);
|
||||
}
|
||||
else if (nr == OBJECT_SELECT_LINKED_PARTICLE) {
|
||||
if (BLI_listbase_is_empty(&ob->particlesystem))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
changed = object_select_all_by_particle(C, ob);
|
||||
}
|
||||
else if (nr == OBJECT_SELECT_LINKED_LIBRARY) {
|
||||
/* do nothing */
|
||||
changed = object_select_all_by_library(C, ob->id.lib);
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "DNA_material_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
|
@ -1775,9 +1774,6 @@ static void copy_mtex_copybuf(ID *id)
|
|||
mtex = &(((World *)id)->mtex[(int)((World *)id)->texact]);
|
||||
// mtex= wrld->mtex[(int)wrld->texact]; // TODO
|
||||
break;
|
||||
case ID_PA:
|
||||
mtex = &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
|
||||
break;
|
||||
case ID_LS:
|
||||
mtex = &(((FreestyleLineStyle *)id)->mtex[(int)((FreestyleLineStyle *)id)->texact]);
|
||||
break;
|
||||
|
@ -1811,9 +1807,6 @@ static void paste_mtex_copybuf(ID *id)
|
|||
mtex = &(((World *)id)->mtex[(int)((World *)id)->texact]);
|
||||
// mtex= wrld->mtex[(int)wrld->texact]; // TODO
|
||||
break;
|
||||
case ID_PA:
|
||||
mtex = &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
|
||||
break;
|
||||
case ID_LS:
|
||||
mtex = &(((FreestyleLineStyle *)id)->mtex[(int)((FreestyleLineStyle *)id)->texact]);
|
||||
break;
|
||||
|
@ -1882,7 +1875,6 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
|
||||
Lamp *la = CTX_data_pointer_get_type(C, "lamp", &RNA_Lamp).data;
|
||||
World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data;
|
||||
ParticleSystem *psys = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data;
|
||||
FreestyleLineStyle *linestyle = CTX_data_pointer_get_type(C, "line_style", &RNA_FreestyleLineStyle).data;
|
||||
|
||||
if (ma)
|
||||
|
@ -1891,8 +1883,6 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
id = &la->id;
|
||||
else if (wo)
|
||||
id = &wo->id;
|
||||
else if (psys)
|
||||
id = &psys->part->id;
|
||||
else if (linestyle)
|
||||
id = &linestyle->id;
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
#include "DNA_armature_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_brush_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
@ -2380,21 +2379,6 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke)
|
|||
|
||||
/* frees prev buffer */
|
||||
copy_wpaint_prev(ts->wpaint, NULL, 0);
|
||||
|
||||
/* and particles too */
|
||||
if (ob->particlesystem.first) {
|
||||
ParticleSystem *psys;
|
||||
int i;
|
||||
|
||||
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
|
||||
for (i = 0; i < PSYS_TOT_VG; i++) {
|
||||
if (psys->vgroup[i] == ob->actdef) {
|
||||
psys->recalc |= PSYS_RECALC_RESET;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DAG_id_tag_update(ob->data, 0);
|
||||
|
||||
|
|
|
@ -46,13 +46,13 @@
|
|||
#include "DNA_world_types.h"
|
||||
#include "DNA_brush_types.h"
|
||||
#include "DNA_linestyle_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_screen.h"
|
||||
#include "BKE_texture.h"
|
||||
#include "BKE_linestyle.h"
|
||||
|
@ -339,34 +339,6 @@ static int buttons_context_path_pose_bone(ButsContextPath *path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int buttons_context_path_particle(ButsContextPath *path)
|
||||
{
|
||||
Object *ob;
|
||||
ParticleSystem *psys;
|
||||
PointerRNA *ptr = &path->ptr[path->len - 1];
|
||||
|
||||
/* if we already have (pinned) particle settings, we're done */
|
||||
if (RNA_struct_is_a(ptr->type, &RNA_ParticleSettings)) {
|
||||
return 1;
|
||||
}
|
||||
/* if we have an object, get the active particle system */
|
||||
if (buttons_context_path_object(path)) {
|
||||
ob = path->ptr[path->len - 1].data;
|
||||
|
||||
if (ob && ob->type == OB_MESH) {
|
||||
psys = psys_get_current(ob);
|
||||
|
||||
RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &path->ptr[path->len]);
|
||||
path->len++;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* no path to a particle system possible */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int buttons_context_path_brush(ButsContextPath *path)
|
||||
{
|
||||
Scene *scene;
|
||||
|
@ -421,8 +393,6 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
|
|||
buttons_context_path_world(path);
|
||||
else if (GS(id->name) == ID_LA)
|
||||
buttons_context_path_data(path, OB_LAMP);
|
||||
else if (GS(id->name) == ID_PA)
|
||||
buttons_context_path_particle(path);
|
||||
else if (GS(id->name) == ID_OB)
|
||||
buttons_context_path_object(path);
|
||||
else if (GS(id->name) == ID_LS)
|
||||
|
@ -441,7 +411,6 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
|
|||
Material *ma;
|
||||
Lamp *la;
|
||||
World *wo;
|
||||
ParticleSystem *psys;
|
||||
FreestyleLineStyle *ls;
|
||||
Tex *tex;
|
||||
PointerRNA *ptr = &path->ptr[path->len - 1];
|
||||
|
@ -462,28 +431,6 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
/* try particles */
|
||||
else if ((path->tex_ctx == SB_TEXC_PARTICLES) && buttons_context_path_particle(path)) {
|
||||
if (path->ptr[path->len - 1].type == &RNA_ParticleSettings) {
|
||||
ParticleSettings *part = path->ptr[path->len - 1].data;
|
||||
|
||||
tex = give_current_particle_texture(part);
|
||||
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
|
||||
path->len++;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
psys = path->ptr[path->len - 1].data;
|
||||
|
||||
if (psys && psys->part && GS(psys->part->id.name) == ID_PA) {
|
||||
tex = give_current_particle_texture(psys->part);
|
||||
|
||||
RNA_id_pointer_create(&tex->id, &path->ptr[path->len]);
|
||||
path->len++;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* try material */
|
||||
else if ((path->tex_ctx == SB_TEXC_MATERIAL) && buttons_context_path_material(path, true, false)) {
|
||||
ma = path->ptr[path->len - 1].data;
|
||||
|
@ -610,9 +557,6 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
|
|||
case BCONTEXT_DATA:
|
||||
found = buttons_context_path_data(path, -1);
|
||||
break;
|
||||
case BCONTEXT_PARTICLE:
|
||||
found = buttons_context_path_particle(path);
|
||||
break;
|
||||
case BCONTEXT_MATERIAL:
|
||||
found = buttons_context_path_material(path, false, (sbuts->texuser != NULL));
|
||||
break;
|
||||
|
@ -900,14 +844,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
|
|||
ButsContextTexture *ct = sbuts->texuser;
|
||||
PointerRNA *ptr;
|
||||
|
||||
/* Particles slots are used in both old and new textures handling. */
|
||||
if ((ptr = get_pointer_type(path, &RNA_ParticleSystem))) {
|
||||
ParticleSettings *part = ((ParticleSystem *)ptr->data)->part;
|
||||
|
||||
if (part)
|
||||
CTX_data_pointer_set(result, &part->id, &RNA_ParticleSettingsTextureSlot, part->mtex[(int)part->texact]);
|
||||
}
|
||||
else if (ct) {
|
||||
if (ct) {
|
||||
return 0; /* new shading system */
|
||||
}
|
||||
else if ((ptr = get_pointer_type(path, &RNA_Material))) {
|
||||
|
@ -1132,14 +1069,6 @@ ID *buttons_context_id_path(const bContext *C)
|
|||
for (a = path->len - 1; a >= 0; a--) {
|
||||
ptr = &path->ptr[a];
|
||||
|
||||
/* pin particle settings instead of system, since only settings are an idblock*/
|
||||
if (sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
|
||||
if (ptr->type == &RNA_ParticleSystem && ptr->data) {
|
||||
ParticleSystem *psys = (ParticleSystem *)ptr->data;
|
||||
return &psys->part->id;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr->id.data) {
|
||||
return ptr->id.data;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "DNA_node_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_object_force.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
#include "DNA_space_types.h"
|
||||
|
@ -59,7 +58,6 @@
|
|||
#include "BKE_modifier.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_scene.h"
|
||||
#ifdef WITH_FREESTYLE
|
||||
# include "BKE_freestyle.h"
|
||||
|
@ -375,31 +373,9 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
|
|||
buttons_texture_users_find_nodetree(users, &linestyle->id, linestyle->nodetree, N_("Line Style"));
|
||||
|
||||
if (ob) {
|
||||
ParticleSystem *psys = psys_get_current(ob);
|
||||
MTex *mtex;
|
||||
int a;
|
||||
|
||||
/* modifiers */
|
||||
modifiers_foreachTexLink(ob, buttons_texture_modifier_foreach, users);
|
||||
|
||||
/* particle systems */
|
||||
if (psys && !limited_mode) {
|
||||
for (a = 0; a < MAX_MTEX; a++) {
|
||||
mtex = psys->part->mtex[a];
|
||||
|
||||
if (mtex) {
|
||||
PointerRNA ptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_pointer_create(&psys->part->id, &RNA_ParticleSettingsTextureSlot, mtex, &ptr);
|
||||
prop = RNA_struct_find_property(&ptr, "texture");
|
||||
|
||||
buttons_texture_user_property_add(users, &psys->part->id, ptr, prop, N_("Particles"),
|
||||
RNA_struct_ui_icon(&RNA_ParticleSettings), psys->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* field */
|
||||
if (ob->pd && ob->pd->forcefield == PFIELD_TEXTURE) {
|
||||
PointerRNA ptr;
|
||||
|
@ -529,17 +505,6 @@ static void template_texture_select(bContext *C, void *user_p, void *UNUSED(arg)
|
|||
|
||||
ct->texture = tex;
|
||||
|
||||
if (user->ptr.type == &RNA_ParticleSettingsTextureSlot) {
|
||||
/* stupid exception for particle systems which still uses influence
|
||||
* from the old texture system, set the active texture slots as well */
|
||||
ParticleSettings *part = user->ptr.id.data;
|
||||
int a;
|
||||
|
||||
for (a = 0; a < MAX_MTEX; a++)
|
||||
if (user->ptr.data == part->mtex[a])
|
||||
part->texact = a;
|
||||
}
|
||||
|
||||
if (sbuts && tex)
|
||||
sbuts->preview = 1;
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "DNA_group_types.h"
|
||||
#include "DNA_lattice_types.h"
|
||||
#include "DNA_meta_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "BLI_math.h"
|
||||
|
@ -50,7 +51,6 @@
|
|||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_key.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_editmesh.h"
|
||||
|
||||
#include "ED_info.h"
|
||||
|
@ -273,37 +273,7 @@ static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats)
|
|||
{
|
||||
if (base->flag & SELECT) stats->totobjsel++;
|
||||
|
||||
if (ob->transflag & OB_DUPLIPARTS) {
|
||||
/* Dupli Particles */
|
||||
ParticleSystem *psys;
|
||||
ParticleSettings *part;
|
||||
|
||||
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
|
||||
part = psys->part;
|
||||
|
||||
if (part->draw_as == PART_DRAW_OB && part->dup_ob) {
|
||||
int tot = count_particles(psys);
|
||||
stats_object(part->dup_ob, 0, tot, stats);
|
||||
}
|
||||
else if (part->draw_as == PART_DRAW_GR && part->dup_group) {
|
||||
GroupObject *go;
|
||||
int tot, totgroup = 0, cur = 0;
|
||||
|
||||
for (go = part->dup_group->gobject.first; go; go = go->next)
|
||||
totgroup++;
|
||||
|
||||
for (go = part->dup_group->gobject.first; go; go = go->next) {
|
||||
tot = count_particles_mod(psys, totgroup, cur);
|
||||
stats_object(go->ob, 0, tot, stats);
|
||||
cur++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stats_object(ob, base->flag & SELECT, 1, stats);
|
||||
stats->totobj++;
|
||||
}
|
||||
else if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) {
|
||||
if (ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS | OB_DUPLIFACES))) {
|
||||
/* Dupli Verts/Faces */
|
||||
int tot;
|
||||
|
||||
|
|
|
@ -135,7 +135,6 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
|
|||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSNTREE:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
|
|
@ -174,7 +174,6 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
|
|||
case ANIMTYPE_DSSKEY:
|
||||
case ANIMTYPE_DSWOR:
|
||||
case ANIMTYPE_DSNTREE:
|
||||
case ANIMTYPE_DSPART:
|
||||
case ANIMTYPE_DSMBALL:
|
||||
case ANIMTYPE_DSARM:
|
||||
case ANIMTYPE_DSMESH:
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "DNA_material_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meta_types.h"
|
||||
#include "DNA_particle_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_sequence_types.h"
|
||||
|
@ -583,14 +582,6 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
|
|||
else if (md->type == eModifierType_Hook) {
|
||||
outliner_add_element(soops, &ten->subtree, ((HookModifierData *) md)->object, ten, TSE_LINKED_OB, 0);
|
||||
}
|
||||
else if (md->type == eModifierType_ParticleSystem) {
|
||||
ParticleSystem *psys = ((ParticleSystemModifierData *) md)->psys;
|
||||
TreeElement *ten_psys;
|
||||
|
||||
ten_psys = outliner_add_element(soops, &ten->subtree, ob, te, TSE_LINKED_PSYS, 0);
|
||||
ten_psys->directdata = psys;
|
||||
ten_psys->name = psys->part->id.name + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "DNA_constraint_types.h"
|
||||
#include "DNA_mask_types.h"
|
||||
#include "DNA_movieclip_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h" /* PET modes */
|
||||
|
||||
#include "BLI_alloca.h"
|
||||
|
@ -58,7 +59,6 @@
|
|||
#include "BKE_editmesh_bvh.h"
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_constraint.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_unit.h"
|
||||
#include "BKE_mask.h"
|
||||
#include "BKE_report.h"
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "DNA_gpencil_types.h"
|
||||
#include "DNA_movieclip_types.h"
|
||||
#include "DNA_mask_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
|
@ -81,7 +82,6 @@
|
|||
#include "BKE_nla.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_paint.h"
|
||||
#include "BKE_pointcache.h"
|
||||
#include "BKE_report.h"
|
||||
|
|
|
@ -708,8 +708,6 @@ static void recalcData_spaceclip(TransInfo *t)
|
|||
/* helper for recalcData() - for object transforms, typically in the 3D view */
|
||||
static void recalcData_objects(TransInfo *t)
|
||||
{
|
||||
Base *base = t->scene->basact;
|
||||
|
||||
if (t->obedit) {
|
||||
if (ELEM(t->obedit->type, OB_CURVE, OB_SURF)) {
|
||||
Curve *cu = t->obedit->data;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "DNA_gpencil_types.h"
|
||||
#include "DNA_lattice_types.h"
|
||||
#include "DNA_meta_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_view3d_types.h"
|
||||
|
@ -54,7 +55,6 @@
|
|||
#include "BKE_context.h"
|
||||
#include "BKE_curve.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_pointcache.h"
|
||||
#include "BKE_editmesh.h"
|
||||
#include "BKE_lattice.h"
|
||||
|
|
Loading…
Reference in New Issue