diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 286 |
1 files changed, 210 insertions, 76 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 128bdec040f..9ae6b25360a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -13,6 +13,7 @@ #include "BLT_translation.h" +#include "DNA_curves_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" @@ -827,21 +828,21 @@ static const EnumPropertyItem *rna_node_static_type_itemf(bContext *UNUSED(C), tmp.value = NODE_CUSTOM; tmp.identifier = "CUSTOM"; - tmp.name = "Custom"; - tmp.description = "Custom Node"; + tmp.name = N_("Custom"); + tmp.description = N_("Custom Node"); tmp.icon = ICON_NONE; RNA_enum_item_add(&item, &totitem, &tmp); tmp.value = NODE_CUSTOM_GROUP; tmp.identifier = "CUSTOM GROUP"; - tmp.name = "CustomGroup"; - tmp.description = "Custom Group Node"; + tmp.name = N_("CustomGroup"); + tmp.description = N_("Custom Group Node"); tmp.icon = ICON_NONE; RNA_enum_item_add(&item, &totitem, &tmp); tmp.value = NODE_UNDEFINED; tmp.identifier = "UNDEFINED"; - tmp.name = "UNDEFINED"; + tmp.name = N_("UNDEFINED"); tmp.description = ""; tmp.icon = ICON_NONE; RNA_enum_item_add(&item, &totitem, &tmp); @@ -1267,6 +1268,20 @@ static void rna_NodeTree_active_node_set(PointerRNA *ptr, if (node && BLI_findindex(&ntree->nodes, node) != -1) { nodeSetActive(ntree, node); + + /* Handle NODE_DO_OUTPUT as well. */ + if (node->typeinfo->nclass == NODE_CLASS_OUTPUT && node->type != CMP_NODE_OUTPUT_FILE) { + /* If this node becomes the active output, the others of the same type can't be the active + * output anymore. */ + LISTBASE_FOREACH (bNode *, other_node, &ntree->nodes) { + if (other_node->type == node->type) { + other_node->flag &= ~NODE_DO_OUTPUT; + } + } + node->flag |= NODE_DO_OUTPUT; + ntreeSetOutput(ntree); + BKE_ntree_update_tag_active_output_changed(ntree); + } } else { nodeClearActive(ntree); @@ -1878,7 +1893,7 @@ static void rna_Node_unregister(Main *UNUSED(bmain), StructRNA *type) } /* Generic internal registration function. - * Can be used to implement callbacks for registerable RNA node subtypes. + * Can be used to implement callbacks for registerable RNA node sub-types. */ static bNodeType *rna_Node_register_base(Main *bmain, ReportList *reports, @@ -2185,18 +2200,6 @@ static const EnumPropertyItem *rna_GeometryNodeAttributeType_type_with_socket_it generic_attribute_type_supported_with_socket); } -static bool transfer_attribute_type_supported(const EnumPropertyItem *item) -{ - return ELEM( - item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_COLOR, CD_PROP_BOOL, CD_PROP_INT32); -} -static const EnumPropertyItem *rna_NodeGeometryTransferAttribute_type_itemf( - bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) -{ - *r_free = true; - return itemf_function_check(rna_enum_attribute_type_items, transfer_attribute_type_supported); -} - static bool attribute_statistic_type_supported(const EnumPropertyItem *item) { return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3); @@ -3571,7 +3574,7 @@ static void rna_difference_matte_t2_set(PointerRNA *ptr, float value) chroma->t2 = value; } -/* Button Set Funcs for Matte Nodes */ +/* Button Set Functions for Matte Nodes */ static void rna_Matte_t1_set(PointerRNA *ptr, float value) { bNode *node = (bNode *)ptr->data; @@ -4836,6 +4839,7 @@ static void def_math(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, rna_enum_node_math_items); RNA_def_property_ui_text(prop, "Operation", ""); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_NODETREE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); prop = RNA_def_property(srna, "use_clamp", PROP_BOOLEAN, PROP_NONE); @@ -4908,6 +4912,54 @@ static void def_compare(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_sh_mix(StructRNA *srna) +{ + static const EnumPropertyItem rna_enum_mix_data_type_items[] = { + {SOCK_FLOAT, "FLOAT", 0, "Float", ""}, + {SOCK_VECTOR, "VECTOR", 0, "Vector", ""}, + {SOCK_RGBA, "RGBA", 0, "Color", ""}, + {0, NULL, 0, NULL, NULL}, + }; + + static const EnumPropertyItem rna_enum_mix_mode_items[] = { + {NODE_MIX_MODE_UNIFORM, "UNIFORM", 0, "Uniform", "Use a single factor for all components"}, + {NODE_MIX_MODE_NON_UNIFORM, "NON_UNIFORM", 0, "Non-Uniform", "Per component factor"}, + {0, NULL, 0, NULL, NULL}, + }; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeShaderMix", "storage"); + + prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_mix_data_type_items); + RNA_def_property_enum_default(prop, SOCK_FLOAT); + RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); + + prop = RNA_def_property(srna, "factor_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_mix_mode_items); + RNA_def_property_enum_default(prop, NODE_MIX_MODE_UNIFORM); + RNA_def_property_ui_text(prop, "Factor Mode", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); + + prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "blend_type"); + RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items); + RNA_def_property_ui_text(prop, "Blending Mode", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "clamp_factor", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "clamp_factor", 1); + RNA_def_property_ui_text(prop, "Clamp Factor", "Clamp the factor to [0,1] range"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "clamp_result", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "clamp_result", 1); + RNA_def_property_ui_text(prop, "Clamp Result", "Clamp the result to [0,1] range"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + static void def_float_to_int(StructRNA *srna) { PropertyRNA *prop; @@ -5186,6 +5238,11 @@ static void def_sh_attribute(StructRNA *srna) "The attribute is associated with the instancer particle system or object, " "falling back to the Object mode if the attribute isn't found, or the object " "is not instanced"}, + {SHD_ATTRIBUTE_VIEW_LAYER, + "VIEW_LAYER", + 0, + "View Layer", + "The attribute is associated with the View Layer, Scene or World that is being rendered"}, {0, NULL, 0, NULL, NULL}, }; PropertyRNA *prop; @@ -5278,7 +5335,6 @@ static void def_sh_tex_sky(StructRNA *srna) prop = RNA_def_property(srna, "sun_elevation", PROP_FLOAT, PROP_ANGLE); RNA_def_property_ui_text(prop, "Sun Elevation", "Sun angle from horizon"); - RNA_def_property_ui_range(prop, -M_PI, M_PI, 1, 2); RNA_def_property_float_default(prop, M_PI_2); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); @@ -5449,6 +5505,7 @@ static void def_sh_tex_image(StructRNA *srna) RNA_def_property_enum_items(prop, prop_image_extension); RNA_def_property_ui_text( prop, "Extension", "How the image is extrapolated past its original bounds"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Node_update"); prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NONE); @@ -5513,6 +5570,7 @@ static void def_geo_image_texture(StructRNA *srna) RNA_def_property_enum_items(prop, prop_image_extension); RNA_def_property_ui_text( prop, "Extension", "How the image is extrapolated past its original bounds"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_IMAGE); RNA_def_property_update(prop, 0, "rna_Node_update"); } @@ -6474,7 +6532,7 @@ static void def_sh_script(StructRNA *srna) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "add_socket", "rna_ShaderNodeScript_add_socket"); - RNA_def_function_ui_description(func, "Add a socket socket"); + RNA_def_function_ui_description(func, "Add a socket"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); parm = RNA_def_string(func, "name", NULL, 0, "Name", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); @@ -6485,7 +6543,7 @@ static void def_sh_script(StructRNA *srna) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove_socket", "rna_ShaderNodeScript_remove_socket"); - RNA_def_function_ui_description(func, "Remove a socket socket"); + RNA_def_function_ui_description(func, "Remove a socket"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); parm = RNA_def_pointer(func, "sock", "NodeSocket", "Socket", ""); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); @@ -6734,7 +6792,7 @@ static void def_cmp_set_alpha(StructRNA *srna) "REPLACE_ALPHA", 0, "Replace Alpha", - "Replace the input image's alpha channels by the alpha input value"}, + "Replace the input image's alpha channel by the alpha input value"}, {0, NULL, 0, NULL, NULL}, }; @@ -6751,11 +6809,11 @@ static void def_cmp_levels(StructRNA *srna) PropertyRNA *prop; static const EnumPropertyItem channel_items[] = { - {1, "COMBINED_RGB", 0, "Combined", "Combined RGB"}, - {2, "RED", 0, "Red", "Red Channel"}, - {3, "GREEN", 0, "Green", "Green Channel"}, - {4, "BLUE", 0, "Blue", "Blue Channel"}, - {5, "LUMINANCE", 0, "Luminance", "Luminance Channel"}, + {CMP_NODE_LEVLES_LUMINANCE, "COMBINED_RGB", 0, "Combined", "Combined RGB"}, + {CMP_NODE_LEVLES_RED, "RED", 0, "Red", "Red Channel"}, + {CMP_NODE_LEVLES_GREEN, "GREEN", 0, "Green", "Green Channel"}, + {CMP_NODE_LEVLES_BLUE, "BLUE", 0, "Blue", "Blue Channel"}, + {CMP_NODE_LEVLES_LUMINANCE_BT709, "LUMINANCE", 0, "Luminance", "Luminance Channel"}, {0, NULL, 0, NULL, NULL}, }; @@ -6994,6 +7052,7 @@ static void def_cmp_output_file(BlenderRNA *brna, StructRNA *srna) prop = RNA_def_property(srna, "base_path", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "base_path"); RNA_def_property_ui_text(prop, "Base Path", "Base output path for the image"); + RNA_def_property_flag(prop, PROP_PATH_OUTPUT); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "active_input_index", PROP_INT, PROP_NONE); @@ -7042,10 +7101,10 @@ static void def_cmp_dilate_erode(StructRNA *srna) PropertyRNA *prop; static const EnumPropertyItem mode_items[] = { - {CMP_NODE_DILATEERODE_STEP, "STEP", 0, "Step", ""}, - {CMP_NODE_DILATEERODE_DISTANCE_THRESH, "THRESHOLD", 0, "Threshold", ""}, - {CMP_NODE_DILATEERODE_DISTANCE, "DISTANCE", 0, "Distance", ""}, - {CMP_NODE_DILATEERODE_DISTANCE_FEATHER, "FEATHER", 0, "Feather", ""}, + {CMP_NODE_DILATE_ERODE_STEP, "STEP", 0, "Step", ""}, + {CMP_NODE_DILATE_ERODE_DISTANCE_THRESHOLD, "THRESHOLD", 0, "Threshold", ""}, + {CMP_NODE_DILATE_ERODE_DISTANCE, "DISTANCE", 0, "Distance", ""}, + {CMP_NODE_DILATE_ERODE_DISTANCE_FEATHER, "FEATHER", 0, "Feather", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -7062,7 +7121,7 @@ static void def_cmp_dilate_erode(StructRNA *srna) RNA_def_property_ui_text(prop, "Distance", "Distance to grow/shrink (number of iterations)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - /* CMP_NODE_DILATEERODE_DISTANCE_THRESH only */ + /* CMP_NODE_DILATE_ERODE_DISTANCE_THRESH only */ prop = RNA_def_property(srna, "edge", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "custom3"); RNA_def_property_range(prop, -100, 100); @@ -7071,7 +7130,7 @@ static void def_cmp_dilate_erode(StructRNA *srna) RNA_def_struct_sdna_from(srna, "NodeDilateErode", "storage"); - /* CMP_NODE_DILATEERODE_DISTANCE_FEATHER only */ + /* CMP_NODE_DILATE_ERODE_DISTANCE_FEATHER only */ prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff"); RNA_def_property_enum_items(prop, rna_enum_proportional_falloff_curve_only_items); @@ -7124,18 +7183,18 @@ static void def_cmp_scale(StructRNA *srna) PropertyRNA *prop; static const EnumPropertyItem space_items[] = { - {CMP_SCALE_RELATIVE, "RELATIVE", 0, "Relative", ""}, - {CMP_SCALE_ABSOLUTE, "ABSOLUTE", 0, "Absolute", ""}, - {CMP_SCALE_SCENEPERCENT, "SCENE_SIZE", 0, "Scene Size", ""}, - {CMP_SCALE_RENDERPERCENT, "RENDER_SIZE", 0, "Render Size", ""}, + {CMP_NODE_SCALE_RELATIVE, "RELATIVE", 0, "Relative", ""}, + {CMP_NODE_SCALE_ABSOLUTE, "ABSOLUTE", 0, "Absolute", ""}, + {CMP_NODE_SCALE_RENDER_PERCENT, "SCENE_SIZE", 0, "Scene Size", ""}, + {CMP_NODE_SCALE_RENDER_SIZE, "RENDER_SIZE", 0, "Render Size", ""}, {0, NULL, 0, NULL, NULL}, }; /* matching bgpic_camera_frame_items[] */ static const EnumPropertyItem space_frame_items[] = { - {0, "STRETCH", 0, "Stretch", ""}, - {CMP_SCALE_RENDERSIZE_FRAME_ASPECT, "FIT", 0, "Fit", ""}, - {CMP_SCALE_RENDERSIZE_FRAME_ASPECT | CMP_SCALE_RENDERSIZE_FRAME_CROP, "CROP", 0, "Crop", ""}, + {CMP_NODE_SCALE_RENDER_SIZE_STRETCH, "STRETCH", 0, "Stretch", ""}, + {CMP_NODE_SCALE_RENDER_SIZE_FIT, "FIT", 0, "Fit", ""}, + {CMP_NODE_SCALE_RENDER_SIZE_CROP, "CROP", 0, "Crop", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -8047,6 +8106,7 @@ static void def_cmp_lensdist(StructRNA *srna) prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "jit", 1); RNA_def_property_ui_text(prop, "Jitter", "Enable/disable jittering (faster, but also noisier)"); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_NODETREE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_fit", PROP_BOOLEAN, PROP_NONE); @@ -9547,6 +9607,31 @@ static void def_geo_extrude_mesh(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } +static void def_geo_distribute_points_in_volume(StructRNA *srna) +{ + PropertyRNA *prop; + + static const EnumPropertyItem mode_items[] = { + {GEO_NODE_DISTRIBUTE_POINTS_IN_VOLUME_DENSITY_RANDOM, + "DENSITY_RANDOM", + 0, + "Random", + "Distribute points randomly inside of the volume"}, + {GEO_NODE_DISTRIBUTE_POINTS_IN_VOLUME_DENSITY_GRID, + "DENSITY_GRID", + 0, + "Grid", + "Distribute the points in a grid pattern inside of the volume"}, + {0, NULL, 0, NULL, NULL}, + }; + + RNA_def_struct_sdna_from(srna, "NodeGeometryDistributePointsInVolume", "storage"); + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, mode_items); + RNA_def_property_ui_text(prop, "Distribution Method", "Method to use for scattering points"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + static void def_geo_distribute_points_on_faces(StructRNA *srna) { PropertyRNA *prop; @@ -9617,6 +9702,17 @@ static void def_geo_curve_set_handle_positions(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_set_curve_normal(StructRNA *srna) +{ + PropertyRNA *prop; + + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, rna_enum_curve_normal_modes); + RNA_def_property_ui_text(prop, "Mode", "Mode for curve normal evaluation"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + static void def_geo_curve_handle_type_selection(StructRNA *srna) { PropertyRNA *prop; @@ -10331,53 +10427,68 @@ static void def_geo_curve_trim(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } -static void def_geo_transfer_attribute(StructRNA *srna) +static void def_geo_sample_index(StructRNA *srna) { - static EnumPropertyItem mapping_items[] = { - {GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST_FACE_INTERPOLATED, - "NEAREST_FACE_INTERPOLATED", - 0, - "Nearest Face Interpolated", - "Transfer the attribute from the nearest face on a surface (loose points and edges are " - "ignored)"}, - {GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST, - "NEAREST", - 0, - "Nearest", - "Transfer the element from the nearest element (using face and edge centers for the " - "distance computation)"}, - {GEO_NODE_ATTRIBUTE_TRANSFER_INDEX, - "INDEX", - 0, - "Index", - "Transfer the data from the element with the corresponding index in the target geometry"}, - {0, NULL, 0, NULL, NULL}, - }; - PropertyRNA *prop; - RNA_def_struct_sdna_from(srna, "NodeGeometryTransferAttribute", "storage"); - - prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, mapping_items); - RNA_def_property_ui_text(prop, "Mapping", "Mapping between geometries"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); + RNA_def_struct_sdna_from(srna, "NodeGeometrySampleIndex", "storage"); prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_NodeGeometryTransferAttribute_type_itemf"); + RNA_def_property_enum_funcs( + prop, NULL, NULL, "rna_GeometryNodeAttributeType_type_with_socket_itemf"); RNA_def_property_enum_default(prop, CD_PROP_FLOAT); - RNA_def_property_ui_text(prop, "Data Type", "The type for the source and result data"); + RNA_def_property_ui_text(prop, "Data Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items); RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); - RNA_def_property_ui_text(prop, "Domain", "The domain to use on the target geometry"); + RNA_def_property_ui_text(prop, "Domain", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "clamp", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_ui_text(prop, + "Clamp", + "Clamp the indices to the size of the attribute domain instead of " + "outputting a default value for invalid indices"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); +} + +static void def_geo_sample_nearest_surface(StructRNA *srna) +{ + PropertyRNA *prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); + RNA_def_property_enum_funcs( + prop, NULL, NULL, "rna_GeometryNodeAttributeType_type_with_socket_itemf"); + RNA_def_property_enum_default(prop, CD_PROP_FLOAT); + RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + +static void def_geo_sample_nearest(StructRNA *srna) +{ + PropertyRNA *prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom2"); + RNA_def_property_enum_items(prop, rna_enum_attribute_domain_only_mesh_items); + RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); + RNA_def_property_ui_text(prop, "Domain", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } +static void def_geo_sample_uv_surface(StructRNA *srna) +{ + PropertyRNA *prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); + RNA_def_property_enum_funcs( + prop, NULL, NULL, "rna_GeometryNodeAttributeType_type_with_socket_itemf"); + RNA_def_property_enum_default(prop, CD_PROP_FLOAT); + RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + static void def_geo_input_material(StructRNA *srna) { PropertyRNA *prop; @@ -10719,6 +10830,12 @@ static void def_geo_viewer(StructRNA *srna) RNA_def_property_enum_default(prop, CD_PROP_FLOAT); RNA_def_property_ui_text(prop, "Data Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_GeometryNode_socket_update"); + + prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_attribute_domain_with_auto_items); + RNA_def_property_enum_default(prop, ATTR_DOMAIN_POINT); + RNA_def_property_ui_text(prop, "Domain", "Domain to evaluate the field on"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } static void def_geo_realize_instances(StructRNA *srna) @@ -10751,7 +10868,7 @@ static void def_geo_field_at_index(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_GeometryNode_socket_update"); } -static void def_geo_field_on_domain(StructRNA *srna) +static void def_geo_interpolate_domain(StructRNA *srna) { PropertyRNA *prop; @@ -10945,6 +11062,11 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Linked", "True if the socket is connected"); + prop = RNA_def_property(srna, "is_unavailable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_UNAVAIL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Unavailable", "True if the socket is unavailable"); + prop = RNA_def_property(srna, "is_multi_input", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SOCK_MULTI_INPUT); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -11529,6 +11651,8 @@ static void rna_def_node_socket_object(BlenderRNA *brna, RNA_def_property_struct_type(prop, "Object"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); } static void rna_def_node_socket_image(BlenderRNA *brna, @@ -11565,6 +11689,8 @@ static void rna_def_node_socket_image(BlenderRNA *brna, RNA_def_property_struct_type(prop, "Image"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); } static void rna_def_node_socket_geometry(BlenderRNA *brna, @@ -11616,6 +11742,8 @@ static void rna_def_node_socket_collection(BlenderRNA *brna, RNA_def_property_struct_type(prop, "Collection"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); } static void rna_def_node_socket_texture(BlenderRNA *brna, @@ -11652,6 +11780,8 @@ static void rna_def_node_socket_texture(BlenderRNA *brna, RNA_def_property_struct_type(prop, "Texture"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); } static void rna_def_node_socket_material(BlenderRNA *brna, @@ -11692,6 +11822,8 @@ static void rna_def_node_socket_material(BlenderRNA *brna, prop, NULL, NULL, NULL, "rna_NodeSocketMaterial_default_value_poll"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); } static void rna_def_node_socket_standard_types(BlenderRNA *brna) @@ -12094,7 +12226,7 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Custom Color", "Use custom color for the node"); RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL); - prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Color", "Custom color of the node body"); @@ -12386,7 +12518,7 @@ static void rna_def_nodetree_nodes_api(BlenderRNA *brna, PropertyRNA *cprop) prop, "rna_NodeTree_active_node_get", "rna_NodeTree_active_node_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Node", "Active node in this tree"); - RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL); + RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, "rna_NodeTree_update"); } static void rna_def_nodetree_link_api(BlenderRNA *brna, PropertyRNA *cprop) @@ -12564,6 +12696,7 @@ static void rna_def_nodetree(BlenderRNA *brna) RNA_def_property_int_funcs( prop, "rna_NodeTree_active_input_get", "rna_NodeTree_active_input_set", NULL); RNA_def_property_ui_text(prop, "Active Input", "Index of the active input"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE, NULL); prop = RNA_def_property(srna, "outputs", PROP_COLLECTION, PROP_NONE); @@ -12577,6 +12710,7 @@ static void rna_def_nodetree(BlenderRNA *brna) RNA_def_property_int_funcs( prop, "rna_NodeTree_active_output_get", "rna_NodeTree_active_output_set", NULL); RNA_def_property_ui_text(prop, "Active Output", "Index of the active output"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_NODE, NULL); /* exposed as a function for runtime interface type properties */ |