Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/buttons_context.c
| Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | if (buttons_context_path_object(path)) { | ||||
| if (ob && ELEM(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE, OB_GPENCIL)) | if (ob && ELEM(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE, OB_GPENCIL)) | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| static int buttons_context_path_shaderfx(ButsContextPath *path) | |||||
| { | |||||
| Object *ob; | |||||
| if (buttons_context_path_object(path)) { | |||||
| ob = path->ptr[path->len - 1].data; | |||||
| if (ob && ELEM(ob->type, OB_GPENCIL)) | |||||
| return 1; | |||||
| } | |||||
| return 0; | |||||
| } | |||||
| static int buttons_context_path_material(ButsContextPath *path) | static int buttons_context_path_material(ButsContextPath *path) | ||||
| { | { | ||||
| Object *ob; | Object *ob; | ||||
| PointerRNA *ptr = &path->ptr[path->len - 1]; | PointerRNA *ptr = &path->ptr[path->len - 1]; | ||||
| Material *ma; | Material *ma; | ||||
| /* if we already have a (pinned) material, we're done */ | /* if we already have a (pinned) material, we're done */ | ||||
| if (RNA_struct_is_a(ptr->type, &RNA_Material)) { | if (RNA_struct_is_a(ptr->type, &RNA_Material)) { | ||||
| ▲ Show 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | #endif | ||||
| case BCONTEXT_OBJECT: | case BCONTEXT_OBJECT: | ||||
| case BCONTEXT_PHYSICS: | case BCONTEXT_PHYSICS: | ||||
| case BCONTEXT_CONSTRAINT: | case BCONTEXT_CONSTRAINT: | ||||
| found = buttons_context_path_object(path); | found = buttons_context_path_object(path); | ||||
| break; | break; | ||||
| case BCONTEXT_MODIFIER: | case BCONTEXT_MODIFIER: | ||||
| found = buttons_context_path_modifier(path); | found = buttons_context_path_modifier(path); | ||||
| break; | break; | ||||
| case BCONTEXT_SHADERFX: | |||||
| found = buttons_context_path_shaderfx(path); | |||||
| break; | |||||
| case BCONTEXT_DATA: | case BCONTEXT_DATA: | ||||
| found = buttons_context_path_data(path, -1); | found = buttons_context_path_data(path, -1); | ||||
| break; | break; | ||||
| case BCONTEXT_PARTICLE: | case BCONTEXT_PARTICLE: | ||||
| found = buttons_context_path_particle(path); | found = buttons_context_path_particle(path); | ||||
| break; | break; | ||||
| case BCONTEXT_MATERIAL: | case BCONTEXT_MATERIAL: | ||||
| /* the colors of grease pencil are not real materials, but to keep UI consistency, we | /* the colors of grease pencil are not real materials, but to keep UI consistency, we | ||||
| ▲ Show 20 Lines • Show All 536 Lines • Show Last 20 Lines | |||||