Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/buttons_texture.c
| Show First 20 Lines • Show All 333 Lines • ▼ Show 20 Lines | static void template_texture_select(bContext *C, void *user_p, void *UNUSED(arg)) | ||||
| PointerRNA texptr; | PointerRNA texptr; | ||||
| Tex *tex; | Tex *tex; | ||||
| if (!ct) | if (!ct) | ||||
| return; | return; | ||||
| /* set user as active */ | /* set user as active */ | ||||
| if (user->node) { | if (user->node) { | ||||
| ED_node_set_active(CTX_data_main(C), user->ntree, user->node); | ED_node_set_active(CTX_data_main(C), user->ntree, user->node, NULL); | ||||
| ct->texture = NULL; | ct->texture = NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| texptr = RNA_property_pointer_get(&user->ptr, user->prop); | texptr = RNA_property_pointer_get(&user->ptr, user->prop); | ||||
| tex = (RNA_struct_is_a(texptr.type, &RNA_Texture)) ? texptr.data : NULL; | tex = (RNA_struct_is_a(texptr.type, &RNA_Texture)) ? texptr.data : NULL; | ||||
| ct->texture = tex; | ct->texture = tex; | ||||
| ▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines | |||||