diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-12 14:04:31 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-12 14:04:31 +0300 |
commit | 29a792a75b66e0222fb29694b9f33c2f70bbcaa6 (patch) | |
tree | 2392e61ea795df1a38ec678f6bd841ee82502d62 /source/blender/editors/space_buttons/buttons_context.c | |
parent | cc468c1974e35674f7d70c153cd7b20fc249aa8d (diff) |
Removed all direct uses of BKE_particle.h and DNA_particle_types.h from source/blender/editors.
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 75 |
1 files changed, 2 insertions, 73 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; } |