diff options
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 75 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_texture.c | 35 |
2 files changed, 2 insertions, 108 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 044fa9fb965..23189cb3d1e 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -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; } diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 58c538c4ee5..ac762671380 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -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; } |