Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/buttons_texture.c
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_linestyle_types.h" | #include "DNA_linestyle_types.h" | ||||
| #include "DNA_windowmanager_types.h" | #include "DNA_windowmanager_types.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "BKE_gpencil_modifier.h" | |||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_particle.h" | #include "BKE_particle.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #ifdef WITH_FREESTYLE | #ifdef WITH_FREESTYLE | ||||
| # include "BKE_freestyle.h" | # include "BKE_freestyle.h" | ||||
| #endif | #endif | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | static void buttons_texture_modifier_foreach(void *userData, Object *ob, ModifierData *md, const char *propname) | ||||
| RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr); | RNA_pointer_create(&ob->id, &RNA_Modifier, md, &ptr); | ||||
| prop = RNA_struct_find_property(&ptr, propname); | prop = RNA_struct_find_property(&ptr, propname); | ||||
| buttons_texture_user_property_add(users, &ob->id, ptr, prop, | buttons_texture_user_property_add(users, &ob->id, ptr, prop, | ||||
| N_("Modifiers"), RNA_struct_ui_icon(ptr.type), md->name); | N_("Modifiers"), RNA_struct_ui_icon(ptr.type), md->name); | ||||
| } | } | ||||
| static void buttons_texture_modifier_gpencil_foreach(void *userData, Object *ob, GpencilModifierData *md, const char *propname) | |||||
| { | |||||
| PointerRNA ptr; | |||||
| PropertyRNA *prop; | |||||
| ListBase *users = userData; | |||||
| RNA_pointer_create(&ob->id, &RNA_GpencilModifier, md, &ptr); | |||||
| prop = RNA_struct_find_property(&ptr, propname); | |||||
| buttons_texture_user_property_add(users, &ob->id, ptr, prop, | |||||
| N_("Grease Pencil Modifiers"), RNA_struct_ui_icon(ptr.type), md->name); | |||||
| } | |||||
| static void buttons_texture_users_from_context(ListBase *users, const bContext *C, SpaceButs *sbuts) | static void buttons_texture_users_from_context(ListBase *users, const bContext *C, SpaceButs *sbuts) | ||||
| { | { | ||||
| Scene *scene = NULL; | Scene *scene = NULL; | ||||
| Object *ob = NULL; | Object *ob = NULL; | ||||
| FreestyleLineStyle *linestyle = NULL; | FreestyleLineStyle *linestyle = NULL; | ||||
| Brush *brush = NULL; | Brush *brush = NULL; | ||||
| ID *pinid = sbuts->pinid; | ID *pinid = sbuts->pinid; | ||||
| bool limited_mode = (sbuts->flag & SB_TEX_USER_LIMITED) != 0; | bool limited_mode = (sbuts->flag & SB_TEX_USER_LIMITED) != 0; | ||||
| Show All 35 Lines | static void buttons_texture_users_from_context(ListBase *users, const bContext *C, SpaceButs *sbuts) | ||||
| if (ob) { | if (ob) { | ||||
| ParticleSystem *psys = psys_get_current(ob); | ParticleSystem *psys = psys_get_current(ob); | ||||
| MTex *mtex; | MTex *mtex; | ||||
| int a; | int a; | ||||
| /* modifiers */ | /* modifiers */ | ||||
| modifiers_foreachTexLink(ob, buttons_texture_modifier_foreach, users); | modifiers_foreachTexLink(ob, buttons_texture_modifier_foreach, users); | ||||
| /* grease pencil modifiers */ | |||||
| BKE_gpencil_modifiers_foreachTexLink(ob, buttons_texture_modifier_gpencil_foreach, users); | |||||
| /* particle systems */ | /* particle systems */ | ||||
| if (psys && !limited_mode) { | if (psys && !limited_mode) { | ||||
| for (a = 0; a < MAX_MTEX; a++) { | for (a = 0; a < MAX_MTEX; a++) { | ||||
| mtex = psys->part->mtex[a]; | mtex = psys->part->mtex[a]; | ||||
| if (mtex) { | if (mtex) { | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines | |||||