Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/drawnode.c
| Show First 20 Lines • Show All 3,165 Lines • ▼ Show 20 Lines | case SIM_NODE_PARTICLE_ATTRIBUTE: | ||||
| ntype->draw_buttons = node_simulation_buts_particle_attribute; | ntype->draw_buttons = node_simulation_buts_particle_attribute; | ||||
| break; | break; | ||||
| case SIM_NODE_SET_PARTICLE_ATTRIBUTE: | case SIM_NODE_SET_PARTICLE_ATTRIBUTE: | ||||
| ntype->draw_buttons = node_simulation_buts_set_particle_attribute; | ntype->draw_buttons = node_simulation_buts_set_particle_attribute; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* ****************** BUTTON CALLBACKS FOR FUNCTION NODES ***************** */ | |||||
| static void node_function_buts_boolean_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | |||||
| { | |||||
| uiItemR(layout, ptr, "operation", 0, "", ICON_NONE); | |||||
| } | |||||
| static void node_function_buts_float_compare(uiLayout *layout, | |||||
| bContext *UNUSED(C), | |||||
| PointerRNA *ptr) | |||||
| { | |||||
| uiItemR(layout, ptr, "operation", 0, "", ICON_NONE); | |||||
| } | |||||
| static void node_function_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | |||||
| { | |||||
| uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE); | |||||
| } | |||||
| static void node_function_set_butfunc(bNodeType *ntype) | |||||
| { | |||||
| switch (ntype->type) { | |||||
| case FN_NODE_BOOLEAN_MATH: | |||||
| ntype->draw_buttons = node_function_buts_boolean_math; | |||||
| break; | |||||
| case FN_NODE_FLOAT_COMPARE: | |||||
| ntype->draw_buttons = node_function_buts_float_compare; | |||||
| break; | |||||
| case FN_NODE_SWITCH: | |||||
| ntype->draw_buttons = node_function_buts_switch; | |||||
| break; | |||||
| } | |||||
| } | |||||
| /* ****** init draw callbacks for all tree types, only called in usiblender.c, once ************ */ | /* ****** init draw callbacks for all tree types, only called in usiblender.c, once ************ */ | ||||
| static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | bNodeTree *ntree = (bNodeTree *)ptr->owner_id; | ||||
| bNode *node = ptr->data; | bNode *node = ptr->data; | ||||
| ED_node_tag_update_nodetree(bmain, ntree, node); | ED_node_tag_update_nodetree(bmain, ntree, node); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | NODE_TYPES_BEGIN (ntype) { | ||||
| ntype->resize_area_func = node_resize_area_default; | ntype->resize_area_func = node_resize_area_default; | ||||
| node_common_set_butfunc(ntype); | node_common_set_butfunc(ntype); | ||||
| node_composit_set_butfunc(ntype); | node_composit_set_butfunc(ntype); | ||||
| node_shader_set_butfunc(ntype); | node_shader_set_butfunc(ntype); | ||||
| node_texture_set_butfunc(ntype); | node_texture_set_butfunc(ntype); | ||||
| node_simulation_set_butfunc(ntype); | node_simulation_set_butfunc(ntype); | ||||
| node_function_set_butfunc(ntype); | |||||
| /* define update callbacks for socket properties */ | /* define update callbacks for socket properties */ | ||||
| node_template_properties_update(ntype); | node_template_properties_update(ntype); | ||||
| } | } | ||||
| NODE_TYPES_END; | NODE_TYPES_END; | ||||
| /* tree type icons */ | /* tree type icons */ | ||||
| ntreeType_Composite->ui_icon = ICON_NODE_COMPOSITING; | ntreeType_Composite->ui_icon = ICON_NODE_COMPOSITING; | ||||
| ▲ Show 20 Lines • Show All 818 Lines • Show Last 20 Lines | |||||