Merge branch 'master' into geometry-nodes-simulation

This commit is contained in:
Jacques Lucke 2022-11-26 13:51:16 +01:00
commit fa277178e8
66 changed files with 1702 additions and 1510 deletions

View File

@ -326,9 +326,10 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
file(GLOB _sycl_runtime_libraries
${SYCL_ROOT_DIR}/lib/libsycl.so
${SYCL_ROOT_DIR}/lib/libsycl.so.*
${SYCL_ROOT_DIR}/lib/libpi_level_zero.so
${SYCL_ROOT_DIR}/lib/libpi_*.so
)
list(FILTER _sycl_runtime_libraries EXCLUDE REGEX ".*\.py")
list(REMOVE_ITEM _sycl_runtime_libraries "${SYCL_ROOT_DIR}/lib/libpi_opencl.so")
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
unset(_sycl_runtime_libraries)
endif()

View File

@ -972,7 +972,13 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
endforeach()
unset(_sycl_runtime_libraries_glob)
list(APPEND _sycl_runtime_libraries ${SYCL_ROOT_DIR}/bin/pi_level_zero.dll)
file(GLOB _sycl_pi_runtime_libraries_glob
${SYCL_ROOT_DIR}/bin/pi_*.dll
)
list(REMOVE_ITEM _sycl_pi_runtime_libraries_glob "${SYCL_ROOT_DIR}/bin/pi_opencl.dll")
list (APPEND _sycl_runtime_libraries ${_sycl_pi_runtime_libraries_glob})
unset(_sycl_pi_runtime_libraries_glob)
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_sycl_runtime_libraries})
unset(_sycl_runtime_libraries)
endif()

View File

@ -35,6 +35,25 @@ from typing import (
Tuple,
)
# ------------------------------------------------------------------------------
# Long Description
long_description = """# Blender
[Blender](https://www.blender.org) is the free and open source 3D creation suite. It supports the entirety of the 3D pipelinemodeling, rigging, animation, simulation, rendering, compositing and motion tracking, even video editing.
This package provides Blender as a Python module for use in studio pipelines, web services, scientific research, and more.
## Documentation
* [Blender Python API](https://docs.blender.org/api/current/)
* [Blender as a Python Module](https://docs.blender.org/api/current/info_advanced_blender_as_bpy.html)
## Requirements
[System requirements](https://www.blender.org/download/requirements/) are the same as Blender.
Each Blender release supports one Python version, and the package is only compatible with that version."""
# ------------------------------------------------------------------------------
# Generic Functions
@ -195,6 +214,8 @@ def main() -> None:
options={"bdist_wheel": {"plat_name": platform_tag}},
description="Blender as a Python module",
long_description=long_description,
long_description_content_type='text/markdown',
license="GPL-3.0",
author="Blender Foundation",
author_email="bf-committers@blender.org",

View File

@ -31,6 +31,8 @@ bool device_oneapi_init()
* improves stability as of intel/LLVM SYCL-nightly/20220529.
* All these env variable can be set beforehand by end-users and
* will in that case -not- be overwritten. */
/* By default, enable only Level-Zero and if all devices are allowed, also CUDA and HIP.
* OpenCL backend isn't currently well supported. */
# ifdef _WIN32
if (getenv("SYCL_CACHE_PERSISTENT") == nullptr) {
_putenv_s("SYCL_CACHE_PERSISTENT", "1");
@ -39,7 +41,12 @@ bool device_oneapi_init()
_putenv_s("SYCL_CACHE_THRESHOLD", "0");
}
if (getenv("SYCL_DEVICE_FILTER") == nullptr) {
_putenv_s("SYCL_DEVICE_FILTER", "level_zero");
if (getenv("CYCLES_ONEAPI_ALL_DEVICES") == nullptr) {
_putenv_s("SYCL_DEVICE_FILTER", "level_zero");
}
else {
_putenv_s("SYCL_DEVICE_FILTER", "level_zero,cuda,hip");
}
}
if (getenv("SYCL_ENABLE_PCI") == nullptr) {
_putenv_s("SYCL_ENABLE_PCI", "1");
@ -50,7 +57,12 @@ bool device_oneapi_init()
# elif __linux__
setenv("SYCL_CACHE_PERSISTENT", "1", false);
setenv("SYCL_CACHE_THRESHOLD", "0", false);
setenv("SYCL_DEVICE_FILTER", "level_zero", false);
if (getenv("CYCLES_ONEAPI_ALL_DEVICES") == nullptr) {
setenv("SYCL_DEVICE_FILTER", "level_zero", false);
}
else {
setenv("SYCL_DEVICE_FILTER", "level_zero,cuda,hip", false);
}
setenv("SYCL_ENABLE_PCI", "1", false);
setenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_IN_ORDER_QUEUE", "0", false);
# endif

View File

@ -1571,6 +1571,7 @@ struct TexResult;
void BKE_node_system_init(void);
void BKE_node_system_exit(void);
extern bNodeTreeType NodeTreeTypeUndefined;
extern struct bNodeType NodeTypeUndefined;
extern struct bNodeSocketType NodeSocketTypeUndefined;

View File

@ -487,6 +487,18 @@ inline const bNodeSocket &bNode::output_by_identifier(blender::StringRef identif
return *this->runtime->outputs_by_identifier.lookup_as(identifier);
}
inline bNodeSocket &bNode::input_by_identifier(blender::StringRef identifier)
{
BLI_assert(blender::bke::node_tree_runtime::topology_cache_is_available(*this));
return *this->runtime->inputs_by_identifier.lookup_as(identifier);
}
inline bNodeSocket &bNode::output_by_identifier(blender::StringRef identifier)
{
BLI_assert(blender::bke::node_tree_runtime::topology_cache_is_available(*this));
return *this->runtime->outputs_by_identifier.lookup_as(identifier);
}
inline const bNodeTree &bNode::owner_tree() const
{
BLI_assert(blender::bke::node_tree_runtime::topology_cache_is_available(*this));
@ -582,6 +594,11 @@ inline int bNodeSocket::index_in_tree() const
return this->runtime->index_in_all_sockets;
}
inline bool bNodeSocket::is_hidden() const
{
return (this->flag & SOCK_HIDDEN) != 0;
}
inline bool bNodeSocket::is_available() const
{
return (this->flag & SOCK_UNAVAIL) == 0;

View File

@ -168,6 +168,8 @@ static int lib_id_clear_library_data_users_update_cb(LibraryIDLinkCallbackData *
{
ID *id = cb_data->user_data;
if (*cb_data->id_pointer == id) {
/* Even though the ID itself remain the same after being made local, from depsgraph point of
* view this is a different ID. Hence we need to tag all of its users for COW update. */
DEG_id_tag_update_ex(
cb_data->bmain, cb_data->id_owner, ID_RECALC_TAG_FOR_UNDO | ID_RECALC_COPY_ON_WRITE);
return IDWALK_RET_STOP_ITER;
@ -232,6 +234,8 @@ void BKE_lib_id_clear_library_data(Main *bmain, ID *id, const int flags)
BKE_lib_id_clear_library_data(bmain, &key->id, flags);
}
/* Even though the ID itself remain the same after being made local, from depsgraph point of view
* this is a different ID. Hence we rebuild depsgraph relationships. */
DEG_relations_tag_update(bmain);
}

View File

@ -71,10 +71,10 @@
#include "NOD_common.h"
#include "NOD_composite.h"
#include "NOD_function.h"
#include "NOD_geometry.h"
#include "NOD_geometry_nodes_lazy_function.hh"
#include "NOD_node_declaration.hh"
#include "NOD_register.hh"
#include "NOD_shader.h"
#include "NOD_socket.h"
#include "NOD_texture.h"
@ -106,7 +106,7 @@ using blender::nodes::OutputSocketFieldType;
using blender::nodes::SocketDeclaration;
/* Fallback types for undefined tree, nodes, sockets */
static bNodeTreeType NodeTreeTypeUndefined;
bNodeTreeType NodeTreeTypeUndefined;
bNodeType NodeTypeUndefined;
bNodeSocketType NodeSocketTypeUndefined;
@ -2199,7 +2199,10 @@ bNode *nodeAddNode(const struct bContext *C, bNodeTree *ntree, const char *idnam
BKE_ntree_update_tag_node_new(ntree, node);
if (ELEM(node->type, GEO_NODE_INPUT_SCENE_TIME, GEO_NODE_SELF_OBJECT, GEO_NODE_SIMULATION_INPUT)) {
if (ELEM(node->type,
GEO_NODE_INPUT_SCENE_TIME,
GEO_NODE_SELF_OBJECT,
GEO_NODE_SIMULATION_INPUT)) {
DEG_relations_tag_update(CTX_data_main(C));
}
@ -4197,512 +4200,13 @@ void node_type_storage(bNodeType *ntype,
ntype->freefunc = freefunc;
}
/* callbacks for undefined types */
static bool node_undefined_poll(bNodeType * /*ntype*/,
bNodeTree * /*nodetree*/,
const char ** /*r_disabled_hint*/)
{
/* this type can not be added deliberately, it's just a placeholder */
return false;
}
/* register fallback types used for undefined tree, nodes, sockets */
static void register_undefined_types()
{
/* NOTE: these types are not registered in the type hashes,
* they are just used as placeholders in case the actual types are not registered.
*/
NodeTreeTypeUndefined.type = NTREE_UNDEFINED;
strcpy(NodeTreeTypeUndefined.idname, "NodeTreeUndefined");
strcpy(NodeTreeTypeUndefined.ui_name, N_("Undefined"));
strcpy(NodeTreeTypeUndefined.ui_description, N_("Undefined Node Tree Type"));
node_type_base_custom(&NodeTypeUndefined, "NodeUndefined", "Undefined", 0);
NodeTypeUndefined.poll = node_undefined_poll;
BLI_strncpy(NodeSocketTypeUndefined.idname,
"NodeSocketUndefined",
sizeof(NodeSocketTypeUndefined.idname));
/* extra type info for standard socket types */
NodeSocketTypeUndefined.type = SOCK_CUSTOM;
NodeSocketTypeUndefined.subtype = PROP_NONE;
NodeSocketTypeUndefined.use_link_limits_of_type = true;
NodeSocketTypeUndefined.input_link_limit = 0xFFF;
NodeSocketTypeUndefined.output_link_limit = 0xFFF;
}
static void registerCompositNodes()
{
register_node_type_cmp_group();
register_node_type_cmp_rlayers();
register_node_type_cmp_image();
register_node_type_cmp_texture();
register_node_type_cmp_value();
register_node_type_cmp_rgb();
register_node_type_cmp_curve_time();
register_node_type_cmp_scene_time();
register_node_type_cmp_movieclip();
register_node_type_cmp_composite();
register_node_type_cmp_viewer();
register_node_type_cmp_splitviewer();
register_node_type_cmp_output_file();
register_node_type_cmp_view_levels();
register_node_type_cmp_curve_rgb();
register_node_type_cmp_mix_rgb();
register_node_type_cmp_hue_sat();
register_node_type_cmp_brightcontrast();
register_node_type_cmp_gamma();
register_node_type_cmp_exposure();
register_node_type_cmp_invert();
register_node_type_cmp_alphaover();
register_node_type_cmp_zcombine();
register_node_type_cmp_colorbalance();
register_node_type_cmp_huecorrect();
register_node_type_cmp_normal();
register_node_type_cmp_curve_vec();
register_node_type_cmp_map_value();
register_node_type_cmp_map_range();
register_node_type_cmp_normalize();
register_node_type_cmp_filter();
register_node_type_cmp_blur();
register_node_type_cmp_dblur();
register_node_type_cmp_bilateralblur();
register_node_type_cmp_vecblur();
register_node_type_cmp_dilateerode();
register_node_type_cmp_inpaint();
register_node_type_cmp_despeckle();
register_node_type_cmp_defocus();
register_node_type_cmp_posterize();
register_node_type_cmp_sunbeams();
register_node_type_cmp_denoise();
register_node_type_cmp_antialiasing();
register_node_type_cmp_convert_color_space();
register_node_type_cmp_valtorgb();
register_node_type_cmp_rgbtobw();
register_node_type_cmp_setalpha();
register_node_type_cmp_idmask();
register_node_type_cmp_math();
register_node_type_cmp_seprgba();
register_node_type_cmp_combrgba();
register_node_type_cmp_sephsva();
register_node_type_cmp_combhsva();
register_node_type_cmp_sepyuva();
register_node_type_cmp_combyuva();
register_node_type_cmp_sepycca();
register_node_type_cmp_combycca();
register_node_type_cmp_premulkey();
register_node_type_cmp_separate_xyz();
register_node_type_cmp_combine_xyz();
register_node_type_cmp_separate_color();
register_node_type_cmp_combine_color();
register_node_type_cmp_diff_matte();
register_node_type_cmp_distance_matte();
register_node_type_cmp_chroma_matte();
register_node_type_cmp_color_matte();
register_node_type_cmp_channel_matte();
register_node_type_cmp_color_spill();
register_node_type_cmp_luma_matte();
register_node_type_cmp_doubleedgemask();
register_node_type_cmp_keyingscreen();
register_node_type_cmp_keying();
register_node_type_cmp_cryptomatte();
register_node_type_cmp_cryptomatte_legacy();
register_node_type_cmp_translate();
register_node_type_cmp_rotate();
register_node_type_cmp_scale();
register_node_type_cmp_flip();
register_node_type_cmp_crop();
register_node_type_cmp_displace();
register_node_type_cmp_mapuv();
register_node_type_cmp_glare();
register_node_type_cmp_tonemap();
register_node_type_cmp_lensdist();
register_node_type_cmp_transform();
register_node_type_cmp_stabilize2d();
register_node_type_cmp_moviedistortion();
register_node_type_cmp_colorcorrection();
register_node_type_cmp_boxmask();
register_node_type_cmp_ellipsemask();
register_node_type_cmp_bokehimage();
register_node_type_cmp_bokehblur();
register_node_type_cmp_switch();
register_node_type_cmp_switch_view();
register_node_type_cmp_pixelate();
register_node_type_cmp_mask();
register_node_type_cmp_trackpos();
register_node_type_cmp_planetrackdeform();
register_node_type_cmp_cornerpin();
}
static void registerShaderNodes()
{
register_node_type_sh_group();
register_node_type_sh_camera();
register_node_type_sh_gamma();
register_node_type_sh_brightcontrast();
register_node_type_sh_value();
register_node_type_sh_rgb();
register_node_type_sh_wireframe();
register_node_type_sh_wavelength();
register_node_type_sh_blackbody();
register_node_type_sh_mix_rgb();
register_node_type_sh_mix();
register_node_type_sh_valtorgb();
register_node_type_sh_rgbtobw();
register_node_type_sh_shadertorgb();
register_node_type_sh_normal();
register_node_type_sh_mapping();
register_node_type_sh_curve_float();
register_node_type_sh_curve_vec();
register_node_type_sh_curve_rgb();
register_node_type_sh_map_range();
register_node_type_sh_clamp();
register_node_type_sh_math();
register_node_type_sh_vect_math();
register_node_type_sh_vector_rotate();
register_node_type_sh_vect_transform();
register_node_type_sh_squeeze();
register_node_type_sh_invert();
register_node_type_sh_sepcolor();
register_node_type_sh_combcolor();
register_node_type_sh_seprgb();
register_node_type_sh_combrgb();
register_node_type_sh_sephsv();
register_node_type_sh_combhsv();
register_node_type_sh_sepxyz();
register_node_type_sh_combxyz();
register_node_type_sh_hue_sat();
register_node_type_sh_attribute();
register_node_type_sh_bevel();
register_node_type_sh_displacement();
register_node_type_sh_vector_displacement();
register_node_type_sh_geometry();
register_node_type_sh_light_path();
register_node_type_sh_light_falloff();
register_node_type_sh_object_info();
register_node_type_sh_fresnel();
register_node_type_sh_layer_weight();
register_node_type_sh_tex_coord();
register_node_type_sh_particle_info();
register_node_type_sh_bump();
register_node_type_sh_vertex_color();
register_node_type_sh_background();
register_node_type_sh_bsdf_anisotropic();
register_node_type_sh_bsdf_diffuse();
register_node_type_sh_bsdf_principled();
register_node_type_sh_bsdf_glossy();
register_node_type_sh_bsdf_glass();
register_node_type_sh_bsdf_translucent();
register_node_type_sh_bsdf_transparent();
register_node_type_sh_bsdf_velvet();
register_node_type_sh_bsdf_toon();
register_node_type_sh_bsdf_hair();
register_node_type_sh_bsdf_hair_principled();
register_node_type_sh_emission();
register_node_type_sh_holdout();
register_node_type_sh_volume_absorption();
register_node_type_sh_volume_scatter();
register_node_type_sh_volume_principled();
register_node_type_sh_subsurface_scattering();
register_node_type_sh_mix_shader();
register_node_type_sh_add_shader();
register_node_type_sh_uvmap();
register_node_type_sh_uvalongstroke();
register_node_type_sh_eevee_specular();
register_node_type_sh_output_light();
register_node_type_sh_output_material();
register_node_type_sh_output_world();
register_node_type_sh_output_linestyle();
register_node_type_sh_output_aov();
register_node_type_sh_tex_image();
register_node_type_sh_tex_environment();
register_node_type_sh_tex_sky();
register_node_type_sh_tex_noise();
register_node_type_sh_tex_wave();
register_node_type_sh_tex_voronoi();
register_node_type_sh_tex_musgrave();
register_node_type_sh_tex_gradient();
register_node_type_sh_tex_magic();
register_node_type_sh_tex_checker();
register_node_type_sh_tex_brick();
register_node_type_sh_tex_pointdensity();
register_node_type_sh_tex_ies();
register_node_type_sh_tex_white_noise();
}
static void registerTextureNodes()
{
register_node_type_tex_group();
register_node_type_tex_math();
register_node_type_tex_mix_rgb();
register_node_type_tex_valtorgb();
register_node_type_tex_rgbtobw();
register_node_type_tex_valtonor();
register_node_type_tex_curve_rgb();
register_node_type_tex_curve_time();
register_node_type_tex_invert();
register_node_type_tex_hue_sat();
register_node_type_tex_coord();
register_node_type_tex_distance();
register_node_type_tex_compose();
register_node_type_tex_decompose();
register_node_type_tex_combine_color();
register_node_type_tex_separate_color();
register_node_type_tex_output();
register_node_type_tex_viewer();
register_node_type_sh_script();
register_node_type_sh_tangent();
register_node_type_sh_normal_map();
register_node_type_sh_hair_info();
register_node_type_sh_point_info();
register_node_type_sh_volume_info();
register_node_type_tex_checker();
register_node_type_tex_texture();
register_node_type_tex_bricks();
register_node_type_tex_image();
register_node_type_sh_bsdf_refraction();
register_node_type_sh_ambient_occlusion();
register_node_type_tex_rotate();
register_node_type_tex_translate();
register_node_type_tex_scale();
register_node_type_tex_at();
register_node_type_tex_proc_voronoi();
register_node_type_tex_proc_blend();
register_node_type_tex_proc_magic();
register_node_type_tex_proc_marble();
register_node_type_tex_proc_clouds();
register_node_type_tex_proc_wood();
register_node_type_tex_proc_musgrave();
register_node_type_tex_proc_noise();
register_node_type_tex_proc_stucci();
register_node_type_tex_proc_distnoise();
}
static void registerGeometryNodes()
{
register_node_type_geo_group();
register_node_type_geo_accumulate_field();
register_node_type_geo_attribute_capture();
register_node_type_geo_attribute_domain_size();
register_node_type_geo_attribute_statistic();
register_node_type_geo_boolean();
register_node_type_geo_bounding_box();
register_node_type_geo_collection_info();
register_node_type_geo_convex_hull();
register_node_type_geo_curve_endpoint_selection();
register_node_type_geo_curve_fill();
register_node_type_geo_curve_fillet();
register_node_type_geo_curve_handle_type_selection();
register_node_type_geo_curve_length();
register_node_type_geo_curve_primitive_arc();
register_node_type_geo_curve_primitive_bezier_segment();
register_node_type_geo_curve_primitive_circle();
register_node_type_geo_curve_primitive_line();
register_node_type_geo_curve_primitive_quadratic_bezier();
register_node_type_geo_curve_primitive_quadrilateral();
register_node_type_geo_curve_primitive_spiral();
register_node_type_geo_curve_primitive_star();
register_node_type_geo_curve_resample();
register_node_type_geo_curve_reverse();
register_node_type_geo_curve_sample();
register_node_type_geo_curve_set_handle_type();
register_node_type_geo_curve_spline_parameter();
register_node_type_geo_curve_spline_type();
register_node_type_geo_curve_subdivide();
register_node_type_geo_curve_to_mesh();
register_node_type_geo_curve_to_points();
register_node_type_geo_curve_topology_curve_of_point();
register_node_type_geo_curve_topology_points_of_curve();
register_node_type_geo_curve_trim();
register_node_type_geo_deform_curves_on_surface();
register_node_type_geo_delete_geometry();
register_node_type_geo_distribute_points_in_volume();
register_node_type_geo_distribute_points_on_faces();
register_node_type_geo_dual_mesh();
register_node_type_geo_duplicate_elements();
register_node_type_geo_edge_paths_to_curves();
register_node_type_geo_edge_paths_to_selection();
register_node_type_geo_edge_split();
register_node_type_geo_extrude_mesh();
register_node_type_geo_field_at_index();
register_node_type_geo_flip_faces();
register_node_type_geo_geometry_to_instance();
register_node_type_geo_image_info();
register_node_type_geo_image_texture();
register_node_type_geo_input_curve_handles();
register_node_type_geo_input_curve_tilt();
register_node_type_geo_input_id();
register_node_type_geo_input_index();
register_node_type_geo_input_instance_rotation();
register_node_type_geo_input_instance_scale();
register_node_type_geo_input_material_index();
register_node_type_geo_input_material();
register_node_type_geo_input_mesh_edge_angle();
register_node_type_geo_input_mesh_edge_neighbors();
register_node_type_geo_input_mesh_edge_vertices();
register_node_type_geo_input_mesh_face_area();
register_node_type_geo_input_mesh_face_is_planar();
register_node_type_geo_input_mesh_face_neighbors();
register_node_type_geo_input_mesh_island();
register_node_type_geo_input_mesh_vertex_neighbors();
register_node_type_geo_input_named_attribute();
register_node_type_geo_input_normal();
register_node_type_geo_input_position();
register_node_type_geo_input_radius();
register_node_type_geo_input_scene_time();
register_node_type_geo_input_shade_smooth();
register_node_type_geo_input_shortest_edge_paths();
register_node_type_geo_input_spline_cyclic();
register_node_type_geo_input_spline_length();
register_node_type_geo_input_spline_resolution();
register_node_type_geo_input_tangent();
register_node_type_geo_instance_on_points();
register_node_type_geo_instances_to_points();
register_node_type_geo_interpolate_domain();
register_node_type_geo_is_viewport();
register_node_type_geo_join_geometry();
register_node_type_geo_material_replace();
register_node_type_geo_material_selection();
register_node_type_geo_merge_by_distance();
register_node_type_geo_mesh_face_set_boundaries();
register_node_type_geo_mesh_primitive_circle();
register_node_type_geo_mesh_primitive_cone();
register_node_type_geo_mesh_primitive_cube();
register_node_type_geo_mesh_primitive_cylinder();
register_node_type_geo_mesh_primitive_grid();
register_node_type_geo_mesh_primitive_ico_sphere();
register_node_type_geo_mesh_primitive_line();
register_node_type_geo_mesh_primitive_uv_sphere();
register_node_type_geo_mesh_subdivide();
register_node_type_geo_mesh_to_curve();
register_node_type_geo_mesh_to_points();
register_node_type_geo_mesh_to_volume();
register_node_type_geo_mesh_topology_offset_corner_in_face();
register_node_type_geo_mesh_topology_corners_of_face();
register_node_type_geo_mesh_topology_corners_of_vertex();
register_node_type_geo_mesh_topology_edges_of_corner();
register_node_type_geo_mesh_topology_edges_of_vertex();
register_node_type_geo_mesh_topology_face_of_corner();
register_node_type_geo_mesh_topology_vertex_of_corner();
register_node_type_geo_object_info();
register_node_type_geo_offset_point_in_curve();
register_node_type_geo_points_to_vertices();
register_node_type_geo_points_to_volume();
register_node_type_geo_points();
register_node_type_geo_proximity();
register_node_type_geo_raycast();
register_node_type_geo_realize_instances();
register_node_type_geo_remove_attribute();
register_node_type_geo_rotate_instances();
register_node_type_geo_sample_index();
register_node_type_geo_sample_nearest_surface();
register_node_type_geo_sample_nearest();
register_node_type_geo_sample_uv_surface();
register_node_type_geo_scale_elements();
register_node_type_geo_scale_instances();
register_node_type_geo_separate_components();
register_node_type_geo_separate_geometry();
register_node_type_geo_self_object();
register_node_type_geo_set_curve_handles();
register_node_type_geo_set_curve_normal();
register_node_type_geo_set_curve_radius();
register_node_type_geo_set_curve_tilt();
register_node_type_geo_set_id();
register_node_type_geo_set_material_index();
register_node_type_geo_set_material();
register_node_type_geo_set_point_radius();
register_node_type_geo_set_position();
register_node_type_geo_set_shade_smooth();
register_node_type_geo_set_spline_cyclic();
register_node_type_geo_set_spline_resolution();
register_node_type_geo_simulation_input();
register_node_type_geo_simulation_output();
register_node_type_geo_store_named_attribute();
register_node_type_geo_string_join();
register_node_type_geo_string_to_curves();
register_node_type_geo_subdivision_surface();
register_node_type_geo_switch();
register_node_type_geo_transform();
register_node_type_geo_translate_instances();
register_node_type_geo_triangulate();
register_node_type_geo_uv_pack_islands();
register_node_type_geo_uv_unwrap();
register_node_type_geo_viewer();
register_node_type_geo_volume_cube();
register_node_type_geo_volume_to_mesh();
}
static void registerFunctionNodes()
{
register_node_type_fn_align_euler_to_vector();
register_node_type_fn_boolean_math();
register_node_type_fn_combine_color();
register_node_type_fn_compare();
register_node_type_fn_float_to_int();
register_node_type_fn_input_bool();
register_node_type_fn_input_color();
register_node_type_fn_input_int();
register_node_type_fn_input_special_characters();
register_node_type_fn_input_string();
register_node_type_fn_input_vector();
register_node_type_fn_random_value();
register_node_type_fn_replace_string();
register_node_type_fn_rotate_euler();
register_node_type_fn_separate_color();
register_node_type_fn_slice_string();
register_node_type_fn_string_length();
register_node_type_fn_value_to_string();
}
void BKE_node_system_init()
{
nodetreetypes_hash = BLI_ghash_str_new("nodetreetypes_hash gh");
nodetypes_hash = BLI_ghash_str_new("nodetypes_hash gh");
nodesockettypes_hash = BLI_ghash_str_new("nodesockettypes_hash gh");
register_undefined_types();
register_standard_node_socket_types();
register_node_tree_type_cmp();
register_node_tree_type_sh();
register_node_tree_type_tex();
register_node_tree_type_geo();
register_node_type_frame();
register_node_type_reroute();
register_node_type_group_input();
register_node_type_group_output();
registerCompositNodes();
registerShaderNodes();
registerTextureNodes();
registerGeometryNodes();
registerFunctionNodes();
register_nodes();
}
void BKE_node_system_exit()

View File

@ -96,6 +96,19 @@ static void update_socket_vectors_and_owner_node(const bNodeTree &ntree)
}
}
static void update_internal_link_inputs(const bNodeTree &ntree)
{
bNodeTreeRuntime &tree_runtime = *ntree.runtime;
for (bNode *node : tree_runtime.nodes) {
for (bNodeSocket *socket : node->runtime->outputs) {
socket->runtime->internal_link_input = nullptr;
}
for (bNodeLink *link : node->runtime->internal_links) {
link->tosock->runtime->internal_link_input = link->fromsock;
}
}
}
static void update_directly_linked_links_and_sockets(const bNodeTree &ntree)
{
bNodeTreeRuntime &tree_runtime = *ntree.runtime;
@ -416,6 +429,7 @@ static void ensure_topology_cache(const bNodeTree &ntree)
update_node_vector(ntree);
update_link_vector(ntree);
update_socket_vectors_and_owner_node(ntree);
update_internal_link_inputs(ntree);
update_directly_linked_links_and_sockets(ntree);
threading::parallel_invoke(
tree_runtime.nodes.size() > 32,

View File

@ -372,7 +372,7 @@ static void call_convert_to_uninitialized_fn(const GVArray &from,
const IndexMask mask,
GMutableSpan to)
{
fn::MFParamsBuilder params{fn, from.size()};
fn::MFParamsBuilder params{fn, mask.min_array_size()};
params.add_readonly_single_input(from);
params.add_uninitialized_single_output(to);
fn::MFContextBuilder context;

View File

@ -261,9 +261,8 @@ template<typename T, int Size> struct vec_base : public vec_struct_base<T, Size>
vec_base &operator+=(const T &b)
{
vec_base result;
unroll<Size>([&](auto i) { (*this)[i] += b; });
return result;
return *this;
}
friend vec_base operator-(const vec_base &a)

View File

@ -146,6 +146,94 @@ TEST(math_vec_types, VectorTypeConversion)
EXPECT_EQ(d[1], -1.0);
}
TEST(math_vec_types, Add)
{
float2 result = float2(1.0f, 2.0f) + float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result.x, 1.5f);
EXPECT_FLOAT_EQ(result.y, 4.0f);
float2 result2 = float2(1.0f, 2.0f);
result2 += float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result2.x, 1.5f);
EXPECT_FLOAT_EQ(result2.y, 4.0f);
}
TEST(math_vec_types, AddFloatByVector)
{
float2 result = float2(0.5f, 2.0f) + 2.0f;
EXPECT_FLOAT_EQ(result.x, 2.5f);
EXPECT_FLOAT_EQ(result.y, 4.0f);
float2 result2 = 2.0f + float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result2.x, 2.5f);
EXPECT_FLOAT_EQ(result2.y, 4.0f);
float2 result3 = float2(0.5f, 2.0f);
result3 += 2.0f;
EXPECT_FLOAT_EQ(result3.x, 2.5f);
EXPECT_FLOAT_EQ(result3.y, 4.0f);
}
TEST(math_vec_types, Sub)
{
float2 result = float2(1.0f, 2.0f) - float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result.x, 0.5f);
EXPECT_FLOAT_EQ(result.y, 0.0f);
float2 result2 = float2(1.0f, 2.0f);
result2 -= float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result2.x, 0.5f);
EXPECT_FLOAT_EQ(result2.y, 0.0f);
float2 result3 = -float2(1.0f, 2.0f);
EXPECT_FLOAT_EQ(result3.x, -1.0f);
EXPECT_FLOAT_EQ(result3.y, -2.0f);
}
TEST(math_vec_types, SubFloatByVector)
{
float2 result = float2(0.5f, 2.0f) - 2.0f;
EXPECT_FLOAT_EQ(result.x, -1.5f);
EXPECT_FLOAT_EQ(result.y, 0.0f);
float2 result2 = 2.0f - float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result2.x, 1.5f);
EXPECT_FLOAT_EQ(result2.y, 0.0f);
float2 result3 = float2(0.5f, 2.0f);
result3 -= 2.0f;
EXPECT_FLOAT_EQ(result3.x, -1.5f);
EXPECT_FLOAT_EQ(result3.y, 0.0f);
}
TEST(math_vec_types, Mul)
{
float2 result = float2(1.0f, 2.0f) * float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result.x, 0.5f);
EXPECT_FLOAT_EQ(result.y, 4.0f);
float2 result2 = float2(1.0f, 2.0f);
result2 *= float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result2.x, 0.5f);
EXPECT_FLOAT_EQ(result2.y, 4.0f);
}
TEST(math_vec_types, MulFloatByVector)
{
float2 result = float2(0.5f, 2.0f) * 2.0f;
EXPECT_FLOAT_EQ(result.x, 1.0f);
EXPECT_FLOAT_EQ(result.y, 4.0f);
float2 result2 = 2.0f * float2(0.5f, 2.0f);
EXPECT_FLOAT_EQ(result2.x, 1.0f);
EXPECT_FLOAT_EQ(result2.y, 4.0f);
float2 result3 = float2(0.5f, 2.0f);
result3 *= 2.0f;
EXPECT_FLOAT_EQ(result3.x, 1.0f);
EXPECT_FLOAT_EQ(result3.y, 4.0f);
}
TEST(math_vec_types, Divide)
{
float2 a(1.0f, 2.0f);

View File

@ -56,7 +56,6 @@ struct VolumeUniformBufPool {
if (used >= ubos.size()) {
VolumeInfosBuf *buf = new VolumeInfosBuf();
ubos.append(buf);
return buf;
}
return ubos[used++];
}

View File

@ -176,20 +176,3 @@ bool ED_space_node_color_sample(struct Main *bmain,
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
/* node_relationships.cc */
namespace blender::ed::space_node {
void node_insert_on_link_flags_set(SpaceNode &snode, const ARegion &region);
/**
* Assumes link with #NODE_LINKFLAG_HILITE set.
*/
void node_insert_on_link_flags(Main &bmain, SpaceNode &snode);
void node_insert_on_link_flags_clear(bNodeTree &node_tree);
} // namespace blender::ed::space_node
#endif

View File

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "ED_node.h"
struct SpaceNode;
struct ARegion;
struct Main;
struct bNodeTree;
namespace blender::ed::space_node {
void node_insert_on_link_flags_set(SpaceNode &snode, const ARegion &region);
/**
* Assumes link with #NODE_LINKFLAG_HILITE set.
*/
void node_insert_on_link_flags(Main &bmain, SpaceNode &snode);
void node_insert_on_link_flags_clear(bNodeTree &node_tree);
} // namespace blender::ed::space_node

View File

@ -37,15 +37,15 @@ set(SRC
interface.cc
interface_align.c
interface_anim.cc
interface_button_group.c
interface_context_menu.c
interface_button_group.cc
interface_context_menu.cc
interface_context_path.cc
interface_drag.cc
interface_draw.c
interface_draw.cc
interface_dropboxes.cc
interface_handlers.c
interface_icons.c
interface_icons_event.c
interface_icons_event.cc
interface_layout.c
interface_ops.cc
interface_panel.cc

View File

@ -18,14 +18,13 @@ void ui_block_new_button_group(uiBlock *block, uiButtonGroupFlag flag)
{
/* Don't create a new group if there is a "lock" on new groups. */
if (!BLI_listbase_is_empty(&block->button_groups)) {
uiButtonGroup *last_button_group = block->button_groups.last;
uiButtonGroup *last_button_group = static_cast<uiButtonGroup *>(block->button_groups.last);
if (last_button_group->flag & UI_BUTTON_GROUP_LOCK) {
return;
}
}
uiButtonGroup *new_group = MEM_mallocN(sizeof(uiButtonGroup), __func__);
BLI_listbase_clear(&new_group->buttons);
uiButtonGroup *new_group = MEM_cnew<uiButtonGroup>(__func__);
new_group->flag = flag;
BLI_addtail(&block->button_groups, new_group);
}
@ -33,10 +32,10 @@ void ui_block_new_button_group(uiBlock *block, uiButtonGroupFlag flag)
void ui_button_group_add_but(uiBlock *block, uiBut *but)
{
if (BLI_listbase_is_empty(&block->button_groups)) {
ui_block_new_button_group(block, 0);
ui_block_new_button_group(block, uiButtonGroupFlag(0));
}
uiButtonGroup *current_button_group = block->button_groups.last;
uiButtonGroup *current_button_group = static_cast<uiButtonGroup *>(block->button_groups.last);
/* We can't use the button directly because adding it to
* this list would mess with its `prev` and `next` pointers. */

View File

@ -6,7 +6,7 @@
* Generic context popup menus.
*/
#include <string.h>
#include <cstring>
#include "MEM_guardedalloc.h"
@ -59,8 +59,8 @@ static IDProperty *shortcut_property_from_rna(bContext *C, uiBut *but)
* Support can be added at #wm_context_member_from_ptr. */
char *final_data_path = WM_context_path_resolve_property_full(
C, &but->rnapoin, but->rnaprop, but->rnaindex);
if (final_data_path == NULL) {
return NULL;
if (final_data_path == nullptr) {
return nullptr;
}
/* Create ID property of data path, to pass to the operator. */
@ -77,7 +77,9 @@ static const char *shortcut_get_operator_property(bContext *C, uiBut *but, IDPro
{
if (but->optype) {
/* Operator */
*r_prop = (but->opptr && but->opptr->data) ? IDP_CopyProperty(but->opptr->data) : NULL;
*r_prop = (but->opptr && but->opptr->data) ?
IDP_CopyProperty(static_cast<IDProperty *>(but->opptr->data)) :
nullptr;
return but->optype->idname;
}
@ -87,23 +89,23 @@ static const char *shortcut_get_operator_property(bContext *C, uiBut *but, IDPro
if (rnaprop_type == PROP_BOOLEAN) {
/* Boolean */
*r_prop = shortcut_property_from_rna(C, but);
if (*r_prop == NULL) {
return NULL;
if (*r_prop == nullptr) {
return nullptr;
}
return "WM_OT_context_toggle";
}
if (rnaprop_type == PROP_ENUM) {
/* Enum */
*r_prop = shortcut_property_from_rna(C, but);
if (*r_prop == NULL) {
return NULL;
if (*r_prop == nullptr) {
return nullptr;
}
return "WM_OT_context_menu_enum";
}
}
*r_prop = NULL;
return NULL;
*r_prop = nullptr;
return nullptr;
}
static void shortcut_free_operator_property(IDProperty *prop)
@ -120,7 +122,7 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event))
IDProperty *prop;
const char *idname = shortcut_get_operator_property(C, but, &prop);
if (idname == NULL) {
if (idname == nullptr) {
return;
}
@ -131,7 +133,7 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event))
}
else {
/* simply strip the shortcut */
ui_but_add_shortcut(but, NULL, true);
ui_but_add_shortcut(but, nullptr, true);
}
shortcut_free_operator_property(prop);
@ -156,7 +158,7 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *region, void *arg)
&km);
U.runtime.is_dirty = true;
BLI_assert(kmi != NULL);
BLI_assert(kmi != nullptr);
RNA_pointer_create(&wm->id, &RNA_KeyMapItem, kmi, &ptr);
@ -178,8 +180,8 @@ static uiBlock *menu_change_shortcut(bContext *C, ARegion *region, void *arg)
uiItemL(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Change Shortcut"), ICON_HAND);
uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
UI_block_bounds_set_popup(
block, 6 * U.dpi_fac, (const int[2]){-100 * U.dpi_fac, 36 * U.dpi_fac});
const int bounds_offset[2] = {int(-100 * U.dpi_fac), int(36 * U.dpi_fac)};
UI_block_bounds_set_popup(block, 6 * U.dpi_fac, bounds_offset);
shortcut_free_operator_property(prop);
@ -202,17 +204,15 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg)
/* XXX this guess_opname can potentially return a different keymap
* than being found on adding later... */
wmKeyMap *km = WM_keymap_guess_opname(C, idname);
wmKeyMapItem *kmi = WM_keymap_add_item(km,
idname,
&(const KeyMapItem_Params){
.type = EVT_AKEY,
.value = KM_PRESS,
.modifier = 0,
.direction = KM_ANY,
});
KeyMapItem_Params params{};
params.type = EVT_AKEY;
params.value = KM_PRESS;
params.modifier = 0;
params.direction = KM_ANY;
wmKeyMapItem *kmi = WM_keymap_add_item(km, idname, &params);
const int kmi_id = kmi->id;
/* This takes ownership of prop, or prop can be NULL for reset. */
/* This takes ownership of prop, or prop can be nullptr for reset. */
WM_keymap_item_properties_reset(kmi, prop);
/* update and get pointers again */
@ -241,8 +241,8 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg)
uiItemL(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Assign Shortcut"), ICON_HAND);
uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT | UI_ITEM_R_IMMEDIATE, "", ICON_NONE);
UI_block_bounds_set_popup(
block, 6 * U.dpi_fac, (const int[2]){-100 * U.dpi_fac, 36 * U.dpi_fac});
const int bounds_offset[2] = {int(-100 * U.dpi_fac), int(36 * U.dpi_fac)};
UI_block_bounds_set_popup(block, 6 * U.dpi_fac, bounds_offset);
#ifdef USE_KEYMAP_ADD_HACK
g_kmi_id_hack = kmi_id;
@ -251,7 +251,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *region, void *arg)
return block;
}
static void menu_add_shortcut_cancel(struct bContext *C, void *arg1)
static void menu_add_shortcut_cancel(bContext *C, void *arg1)
{
uiBut *but = (uiBut *)arg1;
@ -272,13 +272,13 @@ static void menu_add_shortcut_cancel(struct bContext *C, void *arg1)
WM_keymap_remove_item(km, kmi);
}
static void popup_change_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
static void popup_change_shortcut_func(bContext *C, void *arg1, void * /*arg2*/)
{
uiBut *but = (uiBut *)arg1;
UI_popup_block_invoke(C, menu_change_shortcut, but, NULL);
UI_popup_block_invoke(C, menu_change_shortcut, but, nullptr);
}
static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
static void remove_shortcut_func(bContext *C, void *arg1, void * /*arg2*/)
{
uiBut *but = (uiBut *)arg1;
IDProperty *prop;
@ -292,7 +292,7 @@ static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
EVT_TYPE_MASK_HOTKEY_INCLUDE,
EVT_TYPE_MASK_HOTKEY_EXCLUDE,
&km);
BLI_assert(kmi != NULL);
BLI_assert(kmi != nullptr);
WM_keymap_remove_item(km, kmi);
U.runtime.is_dirty = true;
@ -301,10 +301,10 @@ static void remove_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
but_shortcut_name_func(C, but, 0);
}
static void popup_add_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
static void popup_add_shortcut_func(bContext *C, void *arg1, void * /*arg2*/)
{
uiBut *but = (uiBut *)arg1;
UI_popup_block_ex(C, menu_add_shortcut, NULL, menu_add_shortcut_cancel, but, NULL);
UI_popup_block_ex(C, menu_add_shortcut, nullptr, menu_add_shortcut_cancel, but, nullptr);
}
static bool ui_but_is_user_menu_compatible(bContext *C, uiBut *but)
@ -316,7 +316,7 @@ static bool ui_but_is_user_menu_compatible(bContext *C, uiBut *but)
else if (but->rnaprop) {
if (RNA_property_type(but->rnaprop) == PROP_BOOLEAN) {
char *data_path = WM_context_path_resolve_full(C, &but->rnapoin);
if (data_path != NULL) {
if (data_path != nullptr) {
MEM_freeN(data_path);
result = true;
}
@ -332,7 +332,7 @@ static bool ui_but_is_user_menu_compatible(bContext *C, uiBut *but)
static bUserMenuItem *ui_but_user_menu_find(bContext *C, uiBut *but, bUserMenu *um)
{
if (but->optype) {
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
IDProperty *prop = (but->opptr) ? static_cast<IDProperty *>(but->opptr->data) : nullptr;
return (bUserMenuItem *)ED_screen_user_menu_item_find_operator(
&um->items, but->optype, prop, but->opcontext);
}
@ -346,10 +346,10 @@ static bUserMenuItem *ui_but_user_menu_find(bContext *C, uiBut *but, bUserMenu *
}
MenuType *mt = UI_but_menutype_get(but);
if (mt != NULL) {
if (mt != nullptr) {
return (bUserMenuItem *)ED_screen_user_menu_item_find_menu(&um->items, mt);
}
return NULL;
return nullptr;
}
static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
@ -359,7 +359,7 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
char drawstr[sizeof(but->drawstr)];
ui_but_drawstr_without_sep_char(but, drawstr, sizeof(drawstr));
MenuType *mt = NULL;
MenuType *mt = nullptr;
if (but->optype) {
if (drawstr[0] == '\0') {
/* Hard code overrides for generic operators. */
@ -368,7 +368,7 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
RNA_string_get(but->opptr, "name", idname);
#ifdef WITH_PYTHON
{
const char *expr_imports[] = {"bpy", "bl_ui", NULL};
const char *expr_imports[] = {"bpy", "bl_ui", nullptr};
char expr[256];
SNPRINTF(expr,
"bl_ui.space_toolsystem_common.item_from_id("
@ -376,8 +376,8 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
"bpy.context.space_data.type, "
"'%s').label",
idname);
char *expr_result = NULL;
if (BPY_run_string_as_string(C, expr_imports, expr, NULL, &expr_result)) {
char *expr_result = nullptr;
if (BPY_run_string_as_string(C, expr_imports, expr, nullptr, &expr_result)) {
STRNCPY(drawstr, expr_result);
MEM_freeN(expr_result);
}
@ -392,7 +392,11 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
}
}
ED_screen_user_menu_item_add_operator(
&um->items, drawstr, but->optype, but->opptr ? but->opptr->data : NULL, but->opcontext);
&um->items,
drawstr,
but->optype,
but->opptr ? static_cast<const IDProperty *>(but->opptr->data) : nullptr,
but->opcontext);
}
else if (but->rnaprop) {
/* NOTE: 'member_id' may be a path. */
@ -407,9 +411,9 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
}
}
static void popup_user_menu_add_or_replace_func(bContext *C, void *arg1, void *UNUSED(arg2))
static void popup_user_menu_add_or_replace_func(bContext *C, void *arg1, void * /*arg2*/)
{
uiBut *but = arg1;
uiBut *but = static_cast<uiBut *>(arg1);
bUserMenu *um = ED_screen_user_menu_ensure(C);
U.runtime.is_dirty = true;
ui_but_user_menu_add(C, but, um);
@ -417,8 +421,8 @@ static void popup_user_menu_add_or_replace_func(bContext *C, void *arg1, void *U
static void popup_user_menu_remove_func(bContext *UNUSED(C), void *arg1, void *arg2)
{
bUserMenu *um = arg1;
bUserMenuItem *umi = arg2;
bUserMenu *um = static_cast<bUserMenu *>(arg1);
bUserMenuItem *umi = static_cast<bUserMenuItem *>(arg2);
U.runtime.is_dirty = true;
ED_screen_user_menu_item_remove(&um->items, umi);
}
@ -444,7 +448,7 @@ static void ui_but_menu_add_path_operators(uiLayout *layout, PointerRNA *ptr, Pr
ot,
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open File Externally"),
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&props_ptr);
@ -455,7 +459,7 @@ static void ui_but_menu_add_path_operators(uiLayout *layout, PointerRNA *ptr, Pr
ot,
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Open Location Externally"),
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&props_ptr);
@ -474,10 +478,10 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
uiLayout *layout;
bContextStore *previous_ctx = CTX_store_get(C);
{
uiStringInfo label = {BUT_GET_LABEL, NULL};
uiStringInfo label = {BUT_GET_LABEL, nullptr};
/* highly unlikely getting the label ever fails */
UI_but_string_info_get(C, but, &label, NULL);
UI_but_string_info_get(C, but, &label, nullptr);
pup = UI_popup_menu_begin(C, label.strinfo ? label.strinfo : "", ICON_NONE);
layout = UI_popup_menu_layout(pup);
@ -755,13 +759,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
#if 0 /* Disabled for now. */
ot = WM_operatortype_find("UI_OT_override_type_set_button", false);
uiItemFullO_ptr(
layout, ot, "Overrides Type", ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
layout, ot, "Overrides Type", ICON_NONE, nullptr, WM_OP_INVOKE_DEFAULT, 0, &op_ptr);
RNA_boolean_set(&op_ptr, "all", true);
uiItemFullO_ptr(layout,
ot,
"Single Override Type",
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
@ -786,7 +790,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
"UI_OT_override_type_set_button",
"Override Type",
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
@ -807,7 +811,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
ot,
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Define Overrides"),
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
@ -816,7 +820,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
ot,
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Define Single Override"),
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
@ -827,7 +831,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
"UI_OT_override_type_set_button",
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Define Override"),
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
&op_ptr);
@ -938,17 +942,17 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
/* If the button represents an id, it can set the "id" context pointer. */
if (ED_asset_can_mark_single_from_context(C)) {
ID *id = CTX_data_pointer_get_type(C, "id", &RNA_ID).data;
const ID *id = static_cast<const ID *>(CTX_data_pointer_get_type(C, "id", &RNA_ID).data);
/* Gray out items depending on if data-block is an asset. Preferably this could be done via
* operator poll, but that doesn't work since the operator also works with "selected_ids",
* which isn't cheap to check. */
uiLayout *sub = uiLayoutColumn(layout, true);
uiLayoutSetEnabled(sub, !id->asset_data);
uiItemO(sub, NULL, ICON_NONE, "ASSET_OT_mark");
uiItemO(sub, nullptr, ICON_NONE, "ASSET_OT_mark");
sub = uiLayoutColumn(layout, true);
uiLayoutSetEnabled(sub, id->asset_data);
uiItemO(sub, NULL, ICON_NONE, "ASSET_OT_clear");
uiItemO(sub, nullptr, ICON_NONE, "ASSET_OT_clear");
uiItemS(layout);
}
@ -984,11 +988,11 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
bUserMenu **um_array = ED_screen_user_menus_find(C, &um_array_len);
for (int um_index = 0; um_index < um_array_len; um_index++) {
bUserMenu *um = um_array[um_index];
if (um == NULL) {
if (um == nullptr) {
continue;
}
bUserMenuItem *umi = ui_but_user_menu_find(C, but, um);
if (umi != NULL) {
if (umi != nullptr) {
uiBut *but2 = uiDefIconTextBut(
block,
UI_BTYPE_BUT,
@ -999,7 +1003,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
0,
w,
UI_UNIT_Y,
NULL,
nullptr,
0,
0,
0,
@ -1024,13 +1028,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
0,
w,
UI_UNIT_Y,
NULL,
nullptr,
0,
0,
0,
0,
"Add to a user defined context menu (stored in the user preferences)");
UI_but_func_set(but2, popup_user_menu_add_or_replace_func, but, NULL);
UI_but_func_set(but2, popup_user_menu_add_or_replace_func, but, nullptr);
}
uiItemS(layout);
@ -1039,7 +1043,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
/* Shortcut menu */
IDProperty *prop;
const char *idname = shortcut_get_operator_property(C, but, &prop);
if (idname != NULL) {
if (idname != nullptr) {
uiBlock *block = uiLayoutGetBlock(layout);
const int w = uiLayoutGetWidth(layout);
@ -1073,13 +1077,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
0,
w,
UI_UNIT_Y,
NULL,
nullptr,
0,
0,
0,
0,
"");
UI_but_func_set(but2, popup_change_shortcut_func, but, NULL);
UI_but_func_set(but2, popup_change_shortcut_func, but, nullptr);
}
else {
uiBut *but2 = uiDefIconTextBut(block,
@ -1091,7 +1095,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
0,
w,
UI_UNIT_Y,
NULL,
nullptr,
0,
0,
0,
@ -1111,13 +1115,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
0,
w,
UI_UNIT_Y,
NULL,
nullptr,
0,
0,
0,
0,
"");
UI_but_func_set(but2, remove_shortcut_func, but, NULL);
UI_but_func_set(but2, remove_shortcut_func, but, nullptr);
}
/* only show 'assign' if there's a suitable key map for it to go in */
else if (WM_keymap_guess_opname(C, idname)) {
@ -1131,13 +1135,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
0,
w,
UI_UNIT_Y,
NULL,
nullptr,
0,
0,
0,
0,
"");
UI_but_func_set(but2, popup_add_shortcut_func, but, NULL);
UI_but_func_set(but2, popup_add_shortcut_func, but, nullptr);
}
shortcut_free_operator_property(prop);
@ -1163,7 +1167,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
"WM_OT_doc_view",
CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Online Python Reference"),
ICON_NONE,
NULL,
nullptr,
WM_OP_EXEC_DEFAULT,
0,
&ptr_props);
@ -1173,26 +1177,32 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
}
if (but->optype && U.flag & USER_DEVELOPER_UI) {
uiItemO(layout, NULL, ICON_NONE, "UI_OT_copy_python_command_button");
uiItemO(layout, nullptr, ICON_NONE, "UI_OT_copy_python_command_button");
}
/* perhaps we should move this into (G.debug & G_DEBUG) - campbell */
if (U.flag & USER_DEVELOPER_UI) {
if (ui_block_is_menu(but->block) == false) {
uiItemFullO(
layout, "UI_OT_editsource", NULL, ICON_NONE, NULL, WM_OP_INVOKE_DEFAULT, 0, NULL);
uiItemFullO(layout,
"UI_OT_editsource",
nullptr,
ICON_NONE,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
nullptr);
}
}
if (BKE_addon_find(&U.addons, "ui_translate")) {
uiItemFullO(layout,
"UI_OT_edittranslation_init",
NULL,
nullptr,
ICON_NONE,
NULL,
nullptr,
WM_OP_INVOKE_DEFAULT,
0,
NULL);
nullptr);
}
/* Show header tools for header buttons. */
@ -1203,25 +1213,27 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev
/* skip */
}
else if (ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER)) {
uiItemMenuF(layout, IFACE_("Header"), ICON_NONE, ED_screens_header_tools_menu_create, NULL);
uiItemMenuF(
layout, IFACE_("Header"), ICON_NONE, ED_screens_header_tools_menu_create, nullptr);
}
else if (region->regiontype == RGN_TYPE_NAV_BAR) {
uiItemMenuF(layout,
IFACE_("Navigation Bar"),
ICON_NONE,
ED_screens_navigation_bar_tools_menu_create,
NULL);
nullptr);
}
else if (region->regiontype == RGN_TYPE_FOOTER) {
uiItemMenuF(layout, IFACE_("Footer"), ICON_NONE, ED_screens_footer_tools_menu_create, NULL);
uiItemMenuF(
layout, IFACE_("Footer"), ICON_NONE, ED_screens_footer_tools_menu_create, nullptr);
}
}
/* UI List item context menu. Scripts can add items to it, by default there's nothing shown. */
const ARegion *region = CTX_wm_menu(C) ? CTX_wm_menu(C) : CTX_wm_region(C);
const bool is_inside_listbox = ui_list_find_mouse_over(region, event) != NULL;
const bool is_inside_listbox = ui_list_find_mouse_over(region, event) != nullptr;
const bool is_inside_listrow = is_inside_listbox ?
ui_list_row_find_mouse_over(region, event->xy) != NULL :
ui_list_row_find_mouse_over(region, event->xy) != nullptr :
false;
if (is_inside_listrow) {
MenuType *mt = WM_menutype_find("UI_MT_list_item_context_menu", true);
@ -1257,7 +1269,7 @@ void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *panel)
if (!any_item_visible) {
return;
}
if (panel->type->parent != NULL) {
if (panel->type->parent != nullptr) {
return;
}
if (!UI_panel_can_be_pinned(panel)) {
@ -1282,7 +1294,7 @@ void ui_popup_context_menu_for_panel(bContext *C, ARegion *region, Panel *panel)
/* evil, force shortcut flag */
{
uiBlock *block = uiLayoutGetBlock(layout);
uiBut *but = block->buttons.last;
uiBut *but = static_cast<uiBut *>(block->buttons.last);
but->flag |= UI_BUT_HAS_SEP_CHAR;
}
}

View File

@ -5,8 +5,8 @@
* \ingroup edinterface
*/
#include <math.h>
#include <string.h>
#include <cmath>
#include <cstring>
#include "DNA_color_types.h"
#include "DNA_curve_types.h"
@ -76,49 +76,33 @@ void UI_draw_roundbox_4fv_ex(const rctf *rect,
{
/* WATCH: This is assuming the ModelViewProjectionMatrix is area pixel space.
* If it has been scaled, then it's no longer valid. */
uiWidgetBaseParameters widget_params = {
.recti.xmin = rect->xmin + outline_width,
.recti.ymin = rect->ymin + outline_width,
.recti.xmax = rect->xmax - outline_width,
.recti.ymax = rect->ymax - outline_width,
.rect = *rect,
.radi = rad,
.rad = rad,
.round_corners[0] = (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 1.0f : 0.0f,
.round_corners[1] = (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 1.0f : 0.0f,
.round_corners[2] = (roundboxtype & UI_CNR_TOP_RIGHT) ? 1.0f : 0.0f,
.round_corners[3] = (roundboxtype & UI_CNR_TOP_LEFT) ? 1.0f : 0.0f,
.color_inner1[0] = inner1 ? inner1[0] : 0.0f,
.color_inner1[1] = inner1 ? inner1[1] : 0.0f,
.color_inner1[2] = inner1 ? inner1[2] : 0.0f,
.color_inner1[3] = inner1 ? inner1[3] : 0.0f,
.color_inner2[0] = inner2 ? inner2[0] :
inner1 ? inner1[0] :
0.0f,
.color_inner2[1] = inner2 ? inner2[1] :
inner1 ? inner1[1] :
0.0f,
.color_inner2[2] = inner2 ? inner2[2] :
inner1 ? inner1[2] :
0.0f,
.color_inner2[3] = inner2 ? inner2[3] :
inner1 ? inner1[3] :
0.0f,
.color_outline[0] = outline ? outline[0] :
inner1 ? inner1[0] :
0.0f,
.color_outline[1] = outline ? outline[1] :
inner1 ? inner1[1] :
0.0f,
.color_outline[2] = outline ? outline[2] :
inner1 ? inner1[2] :
0.0f,
.color_outline[3] = outline ? outline[3] :
inner1 ? inner1[3] :
0.0f,
.shade_dir = shade_dir,
.alpha_discard = 1.0f,
};
uiWidgetBaseParameters widget_params{};
widget_params.recti.xmin = rect->xmin + outline_width;
widget_params.recti.ymin = rect->ymin + outline_width;
widget_params.recti.xmax = rect->xmax - outline_width;
widget_params.recti.ymax = rect->ymax - outline_width;
widget_params.rect = *rect;
widget_params.radi = rad;
widget_params.rad = rad;
widget_params.round_corners[0] = (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 1.0f : 0.0f;
widget_params.round_corners[1] = (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 1.0f : 0.0f;
widget_params.round_corners[2] = (roundboxtype & UI_CNR_TOP_RIGHT) ? 1.0f : 0.0f;
widget_params.round_corners[3] = (roundboxtype & UI_CNR_TOP_LEFT) ? 1.0f : 0.0f;
widget_params.color_inner1[0] = inner1 ? inner1[0] : 0.0f;
widget_params.color_inner1[1] = inner1 ? inner1[1] : 0.0f;
widget_params.color_inner1[2] = inner1 ? inner1[2] : 0.0f;
widget_params.color_inner1[3] = inner1 ? inner1[3] : 0.0f;
widget_params.color_inner2[0] = inner2 ? inner2[0] : inner1 ? inner1[0] : 0.0f;
widget_params.color_inner2[1] = inner2 ? inner2[1] : inner1 ? inner1[1] : 0.0f;
widget_params.color_inner2[2] = inner2 ? inner2[2] : inner1 ? inner1[2] : 0.0f;
widget_params.color_inner2[3] = inner2 ? inner2[3] : inner1 ? inner1[3] : 0.0f;
widget_params.color_outline[0] = outline ? outline[0] : inner1 ? inner1[0] : 0.0f;
widget_params.color_outline[1] = outline ? outline[1] : inner1 ? inner1[1] : 0.0f;
widget_params.color_outline[2] = outline ? outline[2] : inner1 ? inner1[2] : 0.0f;
widget_params.color_outline[3] = outline ? outline[3] : inner1 ? inner1[3] : 0.0f;
widget_params.shade_dir = shade_dir;
widget_params.alpha_discard = 1.0f;
GPUBatch *batch = ui_batch_roundbox_widget_get();
GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_BASE);
GPU_batch_uniform_4fv_array(batch, "parameters", 11, (const float(*)[4]) & widget_params);
@ -131,19 +115,19 @@ void UI_draw_roundbox_3ub_alpha(
const rctf *rect, bool filled, float rad, const uchar col[3], uchar alpha)
{
const float colv[4] = {
((float)col[0]) / 255,
((float)col[1]) / 255,
((float)col[2]) / 255,
((float)alpha) / 255,
(float(col[0])) / 255.0f,
(float(col[1])) / 255.0f,
(float(col[2])) / 255.0f,
(float(alpha)) / 255.0f,
};
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : NULL, NULL, 1.0f, colv, U.pixelsize, rad);
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : nullptr, nullptr, 1.0f, colv, U.pixelsize, rad);
}
void UI_draw_roundbox_3fv_alpha(
const rctf *rect, bool filled, float rad, const float col[3], float alpha)
{
const float colv[4] = {col[0], col[1], col[2], alpha};
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : NULL, NULL, 1.0f, colv, U.pixelsize, rad);
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : nullptr, nullptr, 1.0f, colv, U.pixelsize, rad);
}
void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
@ -155,13 +139,13 @@ void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float c
colv[3] *= 0.65f;
}
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : NULL, NULL, 1.0f, colv, U.pixelsize, rad);
UI_draw_roundbox_4fv_ex(rect, (filled) ? colv : nullptr, nullptr, 1.0f, colv, U.pixelsize, rad);
}
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
{
/* Exactly the same as UI_draw_roundbox_aa but does not do the legacy transparency. */
UI_draw_roundbox_4fv_ex(rect, (filled) ? col : NULL, NULL, 1.0f, col, U.pixelsize, rad);
UI_draw_roundbox_4fv_ex(rect, (filled) ? col : nullptr, nullptr, 1.0f, col, U.pixelsize, rad);
}
void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4])
@ -269,9 +253,9 @@ void ui_draw_but_TAB_outline(const rcti *rect,
immUnbindProgram();
}
void ui_draw_but_IMAGE(ARegion *UNUSED(region),
void ui_draw_but_IMAGE(ARegion * /*region*/,
uiBut *but,
const uiWidgetColors *UNUSED(wcol),
const uiWidgetColors * /*wcol*/,
const rcti *rect)
{
#ifdef WITH_HEADLESS
@ -311,8 +295,8 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(region),
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_3D_IMAGE_COLOR);
immDrawPixelsTexTiled(&state,
(float)rect->xmin,
(float)rect->ymin,
float(rect->xmin),
float(rect->ymin),
ibuf->x,
ibuf->y,
GPU_RGBA8,
@ -365,16 +349,12 @@ static void draw_scope_end(const rctf *rect)
/* outline */
UI_draw_roundbox_corner_set(UI_CNR_ALL);
const float color[4] = {0.0f, 0.0f, 0.0f, 0.5f};
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect->xmin - 1,
.xmax = rect->xmax + 1,
.ymin = rect->ymin,
.ymax = rect->ymax + 1,
},
false,
3.0f,
color);
rctf box_rect{};
box_rect.xmin = rect->xmin - 1;
box_rect.xmax = rect->xmax + 1;
box_rect.ymin = rect->ymin;
box_rect.ymax = rect->ymax + 1;
UI_draw_roundbox_4fv(&box_rect, false, 3.0f, color);
}
static void histogram_draw_one(float r,
@ -408,7 +388,7 @@ static void histogram_draw_one(float r,
immBegin(GPU_PRIM_LINE_STRIP, res);
for (int i = 0; i < res; i++) {
const float x2 = x + i * (w / (float)res);
const float x2 = x + i * (w / float(res));
immVertex2f(pos_attr, x2, y + (data[i] * h));
}
immEnd();
@ -421,7 +401,7 @@ static void histogram_draw_one(float r,
immVertex2f(pos_attr, x, y);
immVertex2f(pos_attr, x, y + (data[0] * h));
for (int i = 1; i < res; i++) {
const float x2 = x + i * (w / (float)res);
const float x2 = x + i * (w / float(res));
immVertex2f(pos_attr, x2, y + (data[i] * h));
immVertex2f(pos_attr, x2, y);
}
@ -433,7 +413,7 @@ static void histogram_draw_one(float r,
GPU_blend(GPU_BLEND_ALPHA);
immBegin(GPU_PRIM_LINE_STRIP, res);
for (int i = 0; i < res; i++) {
const float x2 = x + i * (w / (float)res);
const float x2 = x + i * (w / float(res));
immVertex2f(pos_attr, x2, y + (data[i] * h));
}
immEnd();
@ -444,21 +424,20 @@ static void histogram_draw_one(float r,
#define HISTOGRAM_TOT_GRID_LINES 4
void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region),
void ui_draw_but_HISTOGRAM(ARegion * /*region*/,
uiBut *but,
const uiWidgetColors *UNUSED(wcol),
const uiWidgetColors * /*wcol*/,
const rcti *recti)
{
Histogram *hist = (Histogram *)but->poin;
const int res = hist->x_resolution;
const bool is_line = (hist->flag & HISTO_FLAG_LINE) != 0;
rctf rect = {
.xmin = (float)recti->xmin + 1,
.xmax = (float)recti->xmax - 1,
.ymin = (float)recti->ymin + 1,
.ymax = (float)recti->ymax - 1,
};
rctf rect{};
rect.xmin = float(recti->xmin + 1);
rect.xmax = float(recti->xmax - 1);
rect.ymin = float(recti->ymin + 1);
rect.ymax = float(recti->ymax - 1);
const float w = BLI_rctf_size_x(&rect);
const float h = BLI_rctf_size_y(&rect) * hist->ymax;
@ -468,16 +447,13 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region),
float color[4];
UI_GetThemeColor4fv(TH_PREVIEW_BACK, color);
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect.xmin - 1,
.xmax = rect.xmax + 1,
.ymin = rect.ymin - 1,
.ymax = rect.ymax + 1,
},
true,
3.0f,
color);
rctf back_rect{};
back_rect.xmin = rect.xmin - 1;
back_rect.xmax = rect.xmax + 1;
back_rect.ymin = rect.ymin - 1;
back_rect.ymax = rect.ymax + 1;
UI_draw_roundbox_4fv(&back_rect, true, 3.0f, color);
/* need scissor test, histogram can draw outside of boundary */
int scissor[4];
@ -495,7 +471,7 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region),
immUniformColor4f(1.0f, 1.0f, 1.0f, 0.08f);
/* draw grid lines here */
for (int i = 1; i <= HISTOGRAM_TOT_GRID_LINES; i++) {
const float fac = (float)i / (float)HISTOGRAM_TOT_GRID_LINES;
const float fac = float(i) / float(HISTOGRAM_TOT_GRID_LINES);
/* so we can tell the 1.0 color point */
if (i == HISTOGRAM_TOT_GRID_LINES) {
@ -558,7 +534,7 @@ static void waveform_draw_one(float *waveform, int waveform_num, const float col
GPU_vertbuf_attr_fill(vbo, pos_id, waveform);
/* TODO: store the #GPUBatch inside the scope. */
GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_POINTS, vbo, NULL, GPU_BATCH_OWNS_VBO);
GPUBatch *batch = GPU_batch_create_ex(GPU_PRIM_POINTS, vbo, nullptr, GPU_BATCH_OWNS_VBO);
GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR);
GPU_batch_uniform_4f(batch, "color", col[0], col[1], col[2], 1.0f);
GPU_batch_draw(batch);
@ -566,9 +542,9 @@ static void waveform_draw_one(float *waveform, int waveform_num, const float col
GPU_batch_discard(batch);
}
void ui_draw_but_WAVEFORM(ARegion *UNUSED(region),
void ui_draw_but_WAVEFORM(ARegion * /*region*/,
uiBut *but,
const uiWidgetColors *UNUSED(wcol),
const uiWidgetColors * /*wcol*/,
const rcti *recti)
{
Scopes *scopes = (Scopes *)but->poin;
@ -579,16 +555,15 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region),
float colors_alpha[3][3], colorsycc_alpha[3][3];
float min, max;
if (scopes == NULL) {
if (scopes == nullptr) {
return;
}
rctf rect = {
.xmin = (float)recti->xmin + 1,
.xmax = (float)recti->xmax - 1,
.ymin = (float)recti->ymin + 1,
.ymax = (float)recti->ymax - 1,
};
rctf rect{};
rect.xmin = float(recti->xmin + 1);
rect.xmax = float(recti->xmax - 1);
rect.ymin = float(recti->ymin + 1);
rect.ymax = float(recti->ymax - 1);
if (scopes->wavefrm_yfac < 0.5f) {
scopes->wavefrm_yfac = 0.98f;
@ -618,16 +593,12 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region),
float color[4];
UI_GetThemeColor4fv(TH_PREVIEW_BACK, color);
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect.xmin - 1,
.xmax = rect.xmax + 1,
.ymin = rect.ymin - 1,
.ymax = rect.ymax + 1,
},
true,
3.0f,
color);
rctf back_rect{};
back_rect.xmin = rect.xmin - 1.0f;
back_rect.xmax = rect.xmax + 1.0f;
back_rect.ymin = rect.ymin - 1.0f;
back_rect.ymax = rect.ymax + 1.0f;
UI_draw_roundbox_4fv(&back_rect, true, 3.0f, color);
/* need scissor test, waveform can draw outside of boundary */
GPU_scissor_get(scissor);
@ -712,7 +683,7 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region),
immEnd();
}
if (scopes->ok && scopes->waveform_1 != NULL) {
if (scopes->ok && scopes->waveform_1 != nullptr) {
GPU_blend(GPU_BLEND_ADDITIVE);
GPU_point_size(1.0);
@ -835,10 +806,10 @@ static void vectorscope_draw_target(
tangle = atanf(v / u);
}
else if (u > 0 && v < 0) {
tangle = atanf(v / u) + 2.0f * (float)M_PI;
tangle = atanf(v / u) + 2.0f * float(M_PI);
}
else if (u < 0) {
tangle = atanf(v / u) + (float)M_PI;
tangle = atanf(v / u) + float(M_PI);
}
else if (u == 0 && v > 0.0f) {
tangle = M_PI_2;
@ -918,9 +889,9 @@ static void vectorscope_draw_target(
immEnd();
}
void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
void ui_draw_but_VECTORSCOPE(ARegion * /*region*/,
uiBut *but,
const uiWidgetColors *UNUSED(wcol),
const uiWidgetColors * /*wcol*/,
const rcti *recti)
{
const float skin_rad = DEG2RADF(123.0f); /* angle in radians of the skin tone line */
@ -935,12 +906,11 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
{0.75, 0.0, 0.75},
};
rctf rect = {
.xmin = (float)recti->xmin + 1,
.xmax = (float)recti->xmax - 1,
.ymin = (float)recti->ymin + 1,
.ymax = (float)recti->ymax - 1,
};
rctf rect{};
rect.xmin = float(recti->xmin + 1);
rect.xmax = float(recti->xmax - 1);
rect.ymin = float(recti->ymin + 1);
rect.ymax = float(recti->ymax - 1);
const float w = BLI_rctf_size_x(&rect);
const float h = BLI_rctf_size_y(&rect);
@ -955,16 +925,12 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
float color[4];
UI_GetThemeColor4fv(TH_PREVIEW_BACK, color);
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect.xmin - 1,
.xmax = rect.xmax + 1,
.ymin = rect.ymin - 1,
.ymax = rect.ymax + 1,
},
true,
3.0f,
color);
rctf back_rect{};
back_rect.xmin = rect.xmin - 1;
back_rect.xmax = rect.xmax + 1;
back_rect.ymin = rect.ymin - 1;
back_rect.ymax = rect.ymax + 1;
UI_draw_roundbox_4fv(&back_rect, true, 3.0f, color);
/* need scissor test, hvectorscope can draw outside of boundary */
int scissor[4];
@ -995,9 +961,9 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
/* circles */
for (int j = 0; j < 5; j++) {
const int increment = 15;
immBegin(GPU_PRIM_LINE_LOOP, (int)(360 / increment));
immBegin(GPU_PRIM_LINE_LOOP, int(360 / increment));
for (int i = 0; i <= 360 - increment; i += increment) {
const float a = DEG2RADF((float)i);
const float a = DEG2RADF(float(i));
const float r = (j + 1) * 0.1f;
immVertex2f(pos, polar_to_x(centerx, diam, r, a), polar_to_y(centery, diam, r, a));
}
@ -1018,7 +984,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region),
vectorscope_draw_target(pos, centerx, centery, diam, colors[i]);
}
if (scopes->ok && scopes->vecscope != NULL) {
if (scopes->ok && scopes->vecscope != nullptr) {
/* pixel point cloud */
const float col[3] = {alpha, alpha, alpha};
@ -1108,7 +1074,7 @@ static void ui_draw_colorband_handle(uint shdr_pos,
const rcti *rect,
float x,
const float rgb[3],
struct ColorManagedDisplay *display,
ColorManagedDisplay *display,
bool active)
{
const float sizey = BLI_rcti_size_y(rect);
@ -1202,15 +1168,16 @@ static void ui_draw_colorband_handle(uint shdr_pos,
shdr_pos, x - (half_width - 2), y1 + 1, x + (half_width - 2), y1 + height - 2, true);
}
void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const rcti *rect)
void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors * /*wcol*/, const rcti *rect)
{
struct ColorManagedDisplay *display = ui_block_cm_display_get(but->block);
ColorManagedDisplay *display = ui_block_cm_display_get(but->block);
uint pos_id, col_id;
uiButColorBand *but_coba = (uiButColorBand *)but;
ColorBand *coba = (but_coba->edit_coba == NULL) ? (ColorBand *)but->poin : but_coba->edit_coba;
ColorBand *coba = (but_coba->edit_coba == nullptr) ? (ColorBand *)but->poin :
but_coba->edit_coba;
if (coba == NULL) {
if (coba == nullptr) {
return;
}
@ -1257,7 +1224,7 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const
immBegin(GPU_PRIM_TRI_STRIP, (sizex + 1) * 2);
for (int a = 0; a <= sizex; a++) {
const float pos = ((float)a) / sizex;
const float pos = (float(a)) / sizex;
BKE_colorband_evaluate(coba, pos, colf);
if (display) {
IMB_colormanagement_scene_linear_to_display_v3(colf, display);
@ -1277,7 +1244,7 @@ void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *UNUSED(wcol), const
immBegin(GPU_PRIM_TRI_STRIP, (sizex + 1) * 2);
for (int a = 0; a <= sizex; a++) {
const float pos = ((float)a) / sizex;
const float pos = (float(a)) / sizex;
BKE_colorband_evaluate(coba, pos, colf);
if (display) {
IMB_colormanagement_scene_linear_to_display_v3(colf, display);
@ -1352,17 +1319,12 @@ void ui_draw_but_UNITVEC(uiBut *but,
/* backdrop */
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_3ub_alpha(
&(const rctf){
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = rect->ymin,
.ymax = rect->ymax,
},
true,
radius,
wcol->inner,
255);
rctf box_rect{};
box_rect.xmin = rect->xmin;
box_rect.xmax = rect->xmax;
box_rect.ymin = rect->ymin;
box_rect.ymax = rect->ymax;
UI_draw_roundbox_3ub_alpha(&box_rect, true, radius, wcol->inner, 255);
GPU_face_culling(GPU_CULL_BACK);
@ -1383,11 +1345,11 @@ void ui_draw_but_UNITVEC(uiBut *but,
GPU_matrix_scale_1f(size);
GPUBatch *sphere = GPU_batch_preset_sphere(2);
struct SimpleLightingData simple_lighting_data;
SimpleLightingData simple_lighting_data;
copy_v4_fl4(simple_lighting_data.color, diffuse[0], diffuse[1], diffuse[2], 1.0f);
copy_v3_v3(simple_lighting_data.light, light);
GPUUniformBuf *ubo = GPU_uniformbuf_create_ex(
sizeof(struct SimpleLightingData), &simple_lighting_data, __func__);
sizeof(SimpleLightingData), &simple_lighting_data, __func__);
GPU_batch_program_set_builtin(sphere, GPU_SHADER_SIMPLE_LIGHTING);
GPU_batch_uniformbuf_bind(sphere, "simple_lighting_data", ubo);
@ -1475,8 +1437,8 @@ static void gl_shaded_color(const uchar *color, int shade)
void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
{
uiButCurveMapping *but_cumap = (uiButCurveMapping *)but;
CurveMapping *cumap = (but_cumap->edit_cumap == NULL) ? (CurveMapping *)but->poin :
but_cumap->edit_cumap;
CurveMapping *cumap = (but_cumap->edit_cumap == nullptr) ? (CurveMapping *)but->poin :
but_cumap->edit_cumap;
const float clip_size_x = BLI_rctf_size_x(&cumap->curr);
const float clip_size_y = BLI_rctf_size_y(&cumap->curr);
@ -1502,12 +1464,11 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
/* need scissor test, curve can draw outside of boundary */
int scissor[4];
GPU_scissor_get(scissor);
rcti scissor_new = {
.xmin = rect->xmin,
.ymin = rect->ymin,
.xmax = rect->xmax,
.ymax = rect->ymax,
};
rcti scissor_new{};
scissor_new.xmin = rect->xmin;
scissor_new.ymin = rect->ymin;
scissor_new.xmax = rect->xmax;
scissor_new.ymax = rect->ymax;
const rcti scissor_region = {0, region->winx, 0, region->winy};
BLI_rcti_isect(&scissor_new, &scissor_region, &scissor_new);
GPU_scissor(scissor_new.xmin,
@ -1520,13 +1481,11 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
/* magic trigger for curve backgrounds */
const float col[3] = {0.0f, 0.0f, 0.0f}; /* dummy arg */
rcti grid = {
.xmin = rect->xmin + zoomx * (-offsx),
.xmax = grid.xmin + zoomx,
.ymin = rect->ymin + zoomy * (-offsy),
.ymax = grid.ymin + zoomy,
};
rcti grid{};
grid.xmin = rect->xmin + zoomx * (-offsx);
grid.xmax = grid.xmin + zoomx;
grid.ymin = rect->ymin + zoomy * (-offsy);
grid.ymax = grid.ymin + zoomy;
ui_draw_gradient(&grid, col, UI_GRAD_H, 1.0f);
}
@ -1631,7 +1590,7 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
}
immUnbindProgram();
if (cuma->table == NULL) {
if (cuma->table == nullptr) {
BKE_curvemapping_changed(cumap, false);
}
@ -1756,8 +1715,8 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
float fx, fy;
uiButCurveProfile *but_profile = (uiButCurveProfile *)but;
CurveProfile *profile = (but_profile->edit_profile == NULL) ? (CurveProfile *)but->poin :
but_profile->edit_profile;
CurveProfile *profile = (but_profile->edit_profile == nullptr) ? (CurveProfile *)but->poin :
but_profile->edit_profile;
/* Calculate offset and zoom. */
const float zoomx = (BLI_rcti_size_x(rect) - 2.0f) / BLI_rctf_size_x(&profile->view_rect);
@ -1773,12 +1732,12 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
/* Test needed because path can draw outside of boundary. */
int scissor[4];
GPU_scissor_get(scissor);
rcti scissor_new = {
.xmin = rect->xmin,
.ymin = rect->ymin,
.xmax = rect->xmax,
.ymax = rect->ymax,
};
rcti scissor_new{};
scissor_new.xmin = rect->xmin;
scissor_new.ymin = rect->ymin;
scissor_new.xmax = rect->xmax;
scissor_new.ymax = rect->ymax;
const rcti scissor_region = {0, region->winx, 0, region->winy};
BLI_rcti_isect(&scissor_new, &scissor_region, &scissor_new);
GPU_scissor(scissor_new.xmin,
@ -1819,7 +1778,7 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
ui_draw_but_curve_grid(pos, rect, zoomx, zoomy, offsx, offsy, 1.0f);
/* Draw the path's fill. */
if (profile->table == NULL) {
if (profile->table == nullptr) {
BKE_curveprofile_update(profile, PROF_UPDATE_NONE);
}
CurveProfilePoint *pts = profile->table;
@ -1830,7 +1789,8 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
const uint tot_triangles = tot_points - 2;
/* Create array of the positions of the table's points. */
float(*table_coords)[2] = MEM_mallocN(sizeof(*table_coords) * tot_points, "table x coords");
float(*table_coords)[2] = static_cast<float(*)[2]>(
MEM_mallocN(sizeof(*table_coords) * tot_points, __func__));
for (uint i = 0; i < (uint)BKE_curveprofile_table_size(profile); i++) {
/* Only add the points from the table here. */
table_coords[i][0] = pts[i].x;
@ -1870,7 +1830,8 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
/* Calculate the table point indices of the triangles for the profile's fill. */
if (tot_triangles > 0) {
uint(*tri_indices)[3] = MEM_mallocN(sizeof(*tri_indices) * tot_triangles, __func__);
uint(*tri_indices)[3] = static_cast<uint(*)[3]>(
MEM_mallocN(sizeof(*tri_indices) * tot_triangles, __func__));
BLI_polyfill_calc(table_coords, tot_points, -1, tri_indices);
/* Draw the triangles for the profile fill. */
@ -1954,10 +1915,10 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
float color_vert[4], color_vert_select[4], color_sample[4];
UI_GetThemeColor4fv(TH_TEXT_HI, color_vert);
UI_GetThemeColor4fv(TH_TEXT, color_vert_select);
color_sample[0] = (float)wcol->item[0] / 255.0f;
color_sample[1] = (float)wcol->item[1] / 255.0f;
color_sample[2] = (float)wcol->item[2] / 255.0f;
color_sample[3] = (float)wcol->item[3] / 255.0f;
color_sample[0] = float(wcol->item[0]) / 255.0f;
color_sample[1] = float(wcol->item[1]) / 255.0f;
color_sample[2] = float(wcol->item[2]) / 255.0f;
color_sample[3] = float(wcol->item[3]) / 255.0f;
if (len_squared_v3v3(color_vert, color_vert_select) < 0.1f) {
interp_v3_v3v3(color_vert, color_vert_select, color_backdrop, 0.75f);
}
@ -2032,20 +1993,19 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
immUnbindProgram();
}
void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
void ui_draw_but_TRACKPREVIEW(ARegion * /*region*/,
uiBut *but,
const uiWidgetColors *UNUSED(wcol),
const uiWidgetColors * /*wcol*/,
const rcti *recti)
{
bool ok = false;
MovieClipScopes *scopes = (MovieClipScopes *)but->poin;
rctf rect = {
.xmin = (float)recti->xmin + 1,
.xmax = (float)recti->xmax - 1,
.ymin = (float)recti->ymin + 1,
.ymax = (float)recti->ymax - 1,
};
rctf rect{};
rect.xmin = float(recti->xmin + 1);
rect.xmax = float(recti->xmax - 1);
rect.ymin = float(recti->ymin + 1);
rect.ymax = float(recti->ymax - 1);
const int width = BLI_rctf_size_x(&rect) + 1;
const int height = BLI_rctf_size_y(&rect);
@ -2063,16 +2023,12 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
if (scopes->track_disabled) {
const float color[4] = {0.7f, 0.3f, 0.3f, 0.3f};
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect.xmin - 1,
.xmax = rect.xmax + 1,
.ymin = rect.ymin,
.ymax = rect.ymax + 1,
},
true,
3.0f,
color);
rctf disabled_rect{};
disabled_rect.xmin = rect.xmin - 1;
disabled_rect.xmax = rect.xmax + 1;
disabled_rect.ymin = rect.ymin;
disabled_rect.ymax = rect.ymax + 1;
UI_draw_roundbox_4fv(&disabled_rect, true, 3.0f, color);
ok = true;
}
@ -2120,16 +2076,12 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
if (scopes->use_track_mask) {
const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect.xmin - 1,
.xmax = rect.xmax + 1,
.ymin = rect.ymin,
.ymax = rect.ymax + 1,
},
true,
3.0f,
color);
rctf mask_rect{};
mask_rect.xmin = rect.xmin - 1;
mask_rect.xmax = rect.xmax + 1;
mask_rect.ymin = rect.ymin;
mask_rect.ymax = rect.ymax + 1;
UI_draw_roundbox_4fv(&mask_rect, true, 3.0f, color);
}
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_3D_IMAGE_COLOR);
@ -2143,7 +2095,7 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
drawibuf->rect,
1.0f,
1.0f,
NULL);
nullptr);
/* draw cross for pixel position */
GPU_matrix_translate_2f(rect.xmin + scopes->track_pos[0], rect.ymin + scopes->track_pos[1]);
@ -2191,16 +2143,12 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region),
if (!ok) {
const float color[4] = {0.0f, 0.0f, 0.0f, 0.3f};
UI_draw_roundbox_corner_set(UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect.xmin - 1,
.xmax = rect.xmax + 1,
.ymin = rect.ymin,
.ymax = rect.ymax + 1,
},
true,
3.0f,
color);
rctf box_rect{};
box_rect.xmin = rect.xmin - 1;
box_rect.xmax = rect.xmax + 1;
box_rect.ymin = rect.ymin;
box_rect.ymax = rect.ymax + 1;
UI_draw_roundbox_4fv(&box_rect, true, 3.0f, color);
}
/* Restore scissor test. */
@ -2304,8 +2252,7 @@ void UI_draw_box_shadow(const rctf *rect, uchar alpha)
GPU_blend(GPU_BLEND_NONE);
}
void ui_draw_dropshadow(
const rctf *rct, float radius, float aspect, float alpha, int UNUSED(select))
void ui_draw_dropshadow(const rctf *rct, float radius, float aspect, float alpha, int /*select*/)
{
/* This undoes the scale of the view for higher zoom factors to clamp the shadow size. */
const float clamped_aspect = smoothminf(aspect, 1.0f, 0.5f);
@ -2319,23 +2266,22 @@ void ui_draw_dropshadow(
GPU_blend(GPU_BLEND_ALPHA);
uiWidgetBaseParameters widget_params = {
.recti.xmin = rct->xmin,
.recti.ymin = rct->ymin,
.recti.xmax = rct->xmax,
.recti.ymax = rct->ymax - shadow_offset,
.rect.xmin = rct->xmin - shadow_softness,
.rect.ymin = rct->ymin - shadow_softness,
.rect.xmax = rct->xmax + shadow_softness,
.rect.ymax = rct->ymax - shadow_offset + shadow_softness,
.radi = rad,
.rad = rad + shadow_softness,
.round_corners[0] = (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 1.0f : 0.0f,
.round_corners[1] = (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 1.0f : 0.0f,
.round_corners[2] = (roundboxtype & UI_CNR_TOP_RIGHT) ? 1.0f : 0.0f,
.round_corners[3] = (roundboxtype & UI_CNR_TOP_LEFT) ? 1.0f : 0.0f,
.alpha_discard = 1.0f,
};
uiWidgetBaseParameters widget_params{};
widget_params.recti.xmin = rct->xmin;
widget_params.recti.ymin = rct->ymin;
widget_params.recti.xmax = rct->xmax;
widget_params.recti.ymax = rct->ymax - shadow_offset;
widget_params.rect.xmin = rct->xmin - shadow_softness;
widget_params.rect.ymin = rct->ymin - shadow_softness;
widget_params.rect.xmax = rct->xmax + shadow_softness;
widget_params.rect.ymax = rct->ymax - shadow_offset + shadow_softness;
widget_params.radi = rad;
widget_params.rad = rad + shadow_softness;
widget_params.round_corners[0] = (roundboxtype & UI_CNR_BOTTOM_LEFT) ? 1.0f : 0.0f;
widget_params.round_corners[1] = (roundboxtype & UI_CNR_BOTTOM_RIGHT) ? 1.0f : 0.0f;
widget_params.round_corners[2] = (roundboxtype & UI_CNR_TOP_RIGHT) ? 1.0f : 0.0f;
widget_params.round_corners[3] = (roundboxtype & UI_CNR_TOP_LEFT) ? 1.0f : 0.0f;
widget_params.alpha_discard = 1.0f;
GPUBatch *batch = ui_batch_roundbox_shadow_get();
GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_SHADOW);
@ -2345,16 +2291,12 @@ void ui_draw_dropshadow(
/* outline emphasis */
const float color[4] = {0.0f, 0.0f, 0.0f, 0.4f};
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rct->xmin - 0.5f,
.xmax = rct->xmax + 0.5f,
.ymin = rct->ymin - 0.5f,
.ymax = rct->ymax + 0.5f,
},
false,
radius + 0.5f,
color);
rctf rect{};
rect.xmin = rct->xmin - 0.5f;
rect.xmax = rct->xmax + 0.5f;
rect.ymin = rct->ymin - 0.5f;
rect.ymax = rct->ymax + 0.5f;
UI_draw_roundbox_4fv(&rect, false, radius + 0.5f, color);
GPU_blend(GPU_BLEND_NONE);
}

View File

@ -9,54 +9,14 @@
* Event codes are used as identifiers.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "GPU_batch.h"
#include "GPU_immediate.h"
#include "GPU_state.h"
#include "BLI_blenlib.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "DNA_brush_types.h"
#include "DNA_curve_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_workspace_types.h"
#include "RNA_access.h"
#include "RNA_enum_types.h"
#include "BKE_appdir.h"
#include "BKE_icons.h"
#include "BKE_studiolight.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_thumbs.h"
#include "BLI_string.h"
#include "BLF_api.h"
#include "DEG_depsgraph.h"
#include "DRW_engine.h"
#include "ED_datafiles.h"
#include "ED_keyframes_draw.h"
#include "ED_render.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "WM_api.h"
#include "WM_types.h"
#include "interface_intern.h"
@ -77,20 +37,15 @@ static void icon_draw_rect_input_text(
BLF_batch_draw_flush();
}
void icon_draw_rect_input(float x,
float y,
int w,
int h,
float UNUSED(alpha),
short event_type,
short UNUSED(event_value))
void icon_draw_rect_input(
float x, float y, int w, int h, float /*alpha*/, short event_type, short /*event_value*/)
{
rctf rect = {
.xmin = (int)x - U.pixelsize,
.xmax = (int)(x + w + U.pixelsize),
.ymin = (int)(y),
.ymax = (int)(y + h),
};
rctf rect{};
rect.xmin = int(x) - U.pixelsize;
rect.xmax = int(x + w + U.pixelsize);
rect.ymin = int(y);
rect.ymax = int(y + h);
float color[4];
GPU_line_width(1.0f);
UI_GetThemeColor4fv(TH_TEXT, color);
@ -113,7 +68,7 @@ void icon_draw_rect_input(float x,
;
if ((event_type >= EVT_AKEY) && (event_type <= EVT_ZKEY)) {
const char str[2] = {'A' + (event_type - EVT_AKEY), '\0'};
const char str[2] = {char('A' + (event_type - EVT_AKEY)), '\0'};
icon_draw_rect_input_text(&rect, color, str, 13.0f, 0.0f);
}
else if ((event_type >= EVT_F1KEY) && (event_type <= EVT_F24KEY)) {
@ -122,11 +77,13 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, str, event_type > EVT_F9KEY ? 8.5f : 11.5f, 0.0f);
}
else if (event_type == EVT_LEFTSHIFTKEY) { /* Right Shift has already been converted to left. */
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x87, 0xa7, 0x0}, 16.0f, 0.0f);
const char str[] = {0xe2, 0x87, 0xa7, 0x0};
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
}
else if (event_type == EVT_LEFTCTRLKEY) { /* Right Shift has already been converted to left. */
if (platform == MACOS) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x8c, 0x83, 0x0}, 21.0f, -8.0f);
const char str[] = {0xe2, 0x8c, 0x83, 0x0};
icon_draw_rect_input_text(&rect, color, str, 21.0f, -8.0f);
}
else {
icon_draw_rect_input_text(&rect, color, "Ctrl", 9.0f, 0.0f);
@ -134,7 +91,8 @@ void icon_draw_rect_input(float x,
}
else if (event_type == EVT_LEFTALTKEY) { /* Right Alt has already been converted to left. */
if (platform == MACOS) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x8c, 0xa5, 0x0}, 13.0f, 0.0f);
const char str[] = {0xe2, 0x8c, 0xa5, 0x0};
icon_draw_rect_input_text(&rect, color, str, 13.0f, 0.0f);
}
else {
icon_draw_rect_input_text(&rect, color, "Alt", 10.0f, 0.0f);
@ -142,10 +100,12 @@ void icon_draw_rect_input(float x,
}
else if (event_type == EVT_OSKEY) {
if (platform == MACOS) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x8c, 0x98, 0x0}, 16.0f, 0.0f);
const char str[] = {0xe2, 0x8c, 0x98, 0x0};
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
}
else if (platform == MSWIN) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x9d, 0x96, 0x0}, 16.0f, 0.0f);
const char str[] = {0xe2, 0x9d, 0x96, 0x0};
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
}
else {
icon_draw_rect_input_text(&rect, color, "OS", 10.0f, 0.0f);
@ -155,7 +115,8 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, "Del", 9.0f, 0.0f);
}
else if (event_type == EVT_TABKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0xad, 0xbe, 0x0}, 18.0f, -1.5f);
const char str[] = {0xe2, 0xad, 0xbe, 0x0};
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
}
else if (event_type == EVT_HOMEKEY) {
icon_draw_rect_input_text(&rect, color, "Home", 6.0f, 0.0f);
@ -164,37 +125,44 @@ void icon_draw_rect_input(float x,
icon_draw_rect_input_text(&rect, color, "End", 8.0f, 0.0f);
}
else if (event_type == EVT_RETKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x8f, 0x8e, 0x0}, 17.0f, -1.0f);
const char str[] = {0xe2, 0x8f, 0x8e, 0x0};
icon_draw_rect_input_text(&rect, color, str, 17.0f, -1.0f);
}
else if (event_type == EVT_ESCKEY) {
if (platform == MACOS) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x8e, 0x8b, 0x0}, 21.0f, -1.0f);
const char str[] = {0xe2, 0x8e, 0x8b, 0x0};
icon_draw_rect_input_text(&rect, color, str, 21.0f, -1.0f);
}
else {
icon_draw_rect_input_text(&rect, color, "Esc", 8.5f, 0.0f);
}
}
else if (event_type == EVT_PAGEUPKEY) {
icon_draw_rect_input_text(
&rect, color, (const char[]){'P', 0xe2, 0x86, 0x91, 0x0}, 12.0f, 0.0f);
const char str[] = {'P', 0xe2, 0x86, 0x91, 0x0};
icon_draw_rect_input_text(&rect, color, str, 12.0f, 0.0f);
}
else if (event_type == EVT_PAGEDOWNKEY) {
icon_draw_rect_input_text(
&rect, color, (const char[]){'P', 0xe2, 0x86, 0x93, 0x0}, 12.0f, 0.0f);
const char str[] = {'P', 0xe2, 0x86, 0x93, 0x0};
icon_draw_rect_input_text(&rect, color, str, 12.0f, 0.0f);
}
else if (event_type == EVT_LEFTARROWKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x86, 0x90, 0x0}, 18.0f, -1.5f);
const char str[] = {0xe2, 0x86, 0x90, 0x0};
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
}
else if (event_type == EVT_UPARROWKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x86, 0x91, 0x0}, 16.0f, 0.0f);
const char str[] = {0xe2, 0x86, 0x91, 0x0};
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
}
else if (event_type == EVT_RIGHTARROWKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x86, 0x92, 0x0}, 18.0f, -1.5f);
const char str[] = {0xe2, 0x86, 0x92, 0x0};
icon_draw_rect_input_text(&rect, color, str, 18.0f, -1.5f);
}
else if (event_type == EVT_DOWNARROWKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x86, 0x93, 0x0}, 16.0f, 0.0f);
const char str[] = {0xe2, 0x86, 0x93, 0x0};
icon_draw_rect_input_text(&rect, color, str, 16.0f, 0.0f);
}
else if (event_type == EVT_SPACEKEY) {
icon_draw_rect_input_text(&rect, color, (const char[]){0xe2, 0x90, 0xa3, 0x0}, 20.0f, 2.0f);
const char str[] = {0xe2, 0x90, 0xa3, 0x0};
icon_draw_rect_input_text(&rect, color, str, 20.0f, 2.0f);
}
}

View File

@ -1020,7 +1020,7 @@ extern void ui_draw_aligned_panel(const struct uiStyle *style,
bool region_search_filter_active);
void ui_panel_tag_search_filter_match(struct Panel *panel);
/* interface_draw.c */
/* interface_draw.cc */
extern void ui_draw_dropshadow(
const rctf *rct, float radius, float aspect, float alpha, int select);
@ -1287,7 +1287,7 @@ void uiStyleInit(void);
void ui_icon_ensure_deferred(const struct bContext *C, int icon_id, bool big);
int ui_id_icon_get(const struct bContext *C, struct ID *id, bool big);
/* interface_icons_event.c */
/* interface_icons_event.cc */
void icon_draw_rect_input(
float x, float y, int w, int h, float alpha, short event_type, short event_value);
@ -1325,7 +1325,7 @@ void ui_layout_list_set_labels_active(uiLayout *layout);
void ui_item_menutype_func(struct bContext *C, struct uiLayout *layout, void *arg_mt);
void ui_item_paneltype_func(struct bContext *C, struct uiLayout *layout, void *arg_pt);
/* interface_button_group.c */
/* interface_button_group.cc */
/**
* Every function that adds a set of buttons must create another group,
@ -1474,7 +1474,7 @@ struct ARegion *ui_screen_region_find_mouse_over_ex(struct bScreen *screen, cons
struct ARegion *ui_screen_region_find_mouse_over(struct bScreen *screen,
const struct wmEvent *event);
/* interface_context_menu.c */
/* interface_context_menu.cc */
bool ui_popup_context_menu_for_button(struct bContext *C, uiBut *but, const struct wmEvent *event);
/**

View File

@ -46,10 +46,6 @@ static struct bThemeState g_theme_state = {
RGN_TYPE_WINDOW,
};
#define theme_active g_theme_state.theme
#define theme_spacetype g_theme_state.spacetype
#define theme_regionid g_theme_state.regionid
void ui_resources_init(void)
{
UI_icons_init();
@ -75,7 +71,7 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
const uchar *cp = error;
/* ensure we're not getting a color after running BKE_blender_userdef_free */
BLI_assert(BLI_findindex(&U.themes, theme_active) != -1);
BLI_assert(BLI_findindex(&U.themes, g_theme_state.theme) != -1);
BLI_assert(colorid != TH_UNDEFINED);
if (btheme) {
@ -154,19 +150,19 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
switch (colorid) {
case TH_BACK:
if (ELEM(theme_regionid, RGN_TYPE_WINDOW, RGN_TYPE_PREVIEW)) {
if (ELEM(g_theme_state.regionid, RGN_TYPE_WINDOW, RGN_TYPE_PREVIEW)) {
cp = ts->back;
}
else if (theme_regionid == RGN_TYPE_CHANNELS) {
else if (g_theme_state.regionid == RGN_TYPE_CHANNELS) {
cp = ts->list;
}
else if (ELEM(theme_regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
else if (ELEM(g_theme_state.regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
cp = ts->header;
}
else if (theme_regionid == RGN_TYPE_NAV_BAR) {
else if (g_theme_state.regionid == RGN_TYPE_NAV_BAR) {
cp = ts->navigation_bar;
}
else if (theme_regionid == RGN_TYPE_EXECUTE) {
else if (g_theme_state.regionid == RGN_TYPE_EXECUTE) {
cp = ts->execution_buts;
}
else {
@ -174,7 +170,7 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
}
copy_v4_v4_uchar(back, cp);
if (!ED_region_is_overlap(spacetype, theme_regionid)) {
if (!ED_region_is_overlap(spacetype, g_theme_state.regionid)) {
back[3] = 255;
}
cp = back;
@ -188,13 +184,13 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
setting = ts->background_type;
break;
case TH_TEXT:
if (theme_regionid == RGN_TYPE_WINDOW) {
if (g_theme_state.regionid == RGN_TYPE_WINDOW) {
cp = ts->text;
}
else if (theme_regionid == RGN_TYPE_CHANNELS) {
else if (g_theme_state.regionid == RGN_TYPE_CHANNELS) {
cp = ts->list_text;
}
else if (ELEM(theme_regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
else if (ELEM(g_theme_state.regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
cp = ts->header_text;
}
else {
@ -202,13 +198,13 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
}
break;
case TH_TEXT_HI:
if (theme_regionid == RGN_TYPE_WINDOW) {
if (g_theme_state.regionid == RGN_TYPE_WINDOW) {
cp = ts->text_hi;
}
else if (theme_regionid == RGN_TYPE_CHANNELS) {
else if (g_theme_state.regionid == RGN_TYPE_CHANNELS) {
cp = ts->list_text_hi;
}
else if (ELEM(theme_regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
else if (ELEM(g_theme_state.regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
cp = ts->header_text_hi;
}
else {
@ -216,13 +212,13 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
}
break;
case TH_TITLE:
if (theme_regionid == RGN_TYPE_WINDOW) {
if (g_theme_state.regionid == RGN_TYPE_WINDOW) {
cp = ts->title;
}
else if (theme_regionid == RGN_TYPE_CHANNELS) {
else if (g_theme_state.regionid == RGN_TYPE_CHANNELS) {
cp = ts->list_title;
}
else if (ELEM(theme_regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
else if (ELEM(g_theme_state.regionid, RGN_TYPE_HEADER, RGN_TYPE_FOOTER)) {
cp = ts->header_title;
}
else {
@ -1052,21 +1048,21 @@ void UI_SetTheme(int spacetype, int regionid)
{
if (spacetype) {
/* later on, a local theme can be found too */
theme_active = U.themes.first;
theme_spacetype = spacetype;
theme_regionid = regionid;
g_theme_state.theme = U.themes.first;
g_theme_state.spacetype = spacetype;
g_theme_state.regionid = regionid;
}
else if (regionid) {
/* popups */
theme_active = U.themes.first;
theme_spacetype = SPACE_PROPERTIES;
theme_regionid = regionid;
g_theme_state.theme = U.themes.first;
g_theme_state.spacetype = SPACE_PROPERTIES;
g_theme_state.regionid = regionid;
}
else {
/* for safety, when theme was deleted */
theme_active = U.themes.first;
theme_spacetype = SPACE_VIEW3D;
theme_regionid = RGN_TYPE_WINDOW;
g_theme_state.theme = U.themes.first;
g_theme_state.spacetype = SPACE_VIEW3D;
g_theme_state.regionid = RGN_TYPE_WINDOW;
}
}
@ -1087,7 +1083,7 @@ void UI_Theme_Restore(struct bThemeState *theme_state)
void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset, uchar col[4])
{
int r, g, b, a;
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
r = coloffset + (int)cp[0];
CLAMP(r, 0, 255);
g = coloffset + (int)cp[1];
@ -1105,8 +1101,8 @@ void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset,
void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, uchar col[3])
{
const uchar *cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
const uchar *cp1 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
col[0] = floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
@ -1116,8 +1112,8 @@ void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, uchar col[
void UI_GetThemeColorBlend3f(int colorid1, int colorid2, float fac, float r_col[3])
{
const uchar *cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
const uchar *cp1 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
r_col[0] = ((1.0f - fac) * cp1[0] + fac * cp2[0]) / 255.0f;
@ -1127,8 +1123,8 @@ void UI_GetThemeColorBlend3f(int colorid1, int colorid2, float fac, float r_col[
void UI_GetThemeColorBlend4f(int colorid1, int colorid2, float fac, float r_col[4])
{
const uchar *cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
const uchar *cp1 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
r_col[0] = ((1.0f - fac) * cp1[0] + fac * cp2[0]) / 255.0f;
@ -1146,31 +1142,31 @@ void UI_FontThemeColor(int fontid, int colorid)
float UI_GetThemeValuef(int colorid)
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
return ((float)cp[0]);
}
int UI_GetThemeValue(int colorid)
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
return ((int)cp[0]);
}
float UI_GetThemeValueTypef(int colorid, int spacetype)
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, spacetype, colorid);
return ((float)cp[0]);
}
int UI_GetThemeValueType(int colorid, int spacetype)
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, spacetype, colorid);
return ((int)cp[0]);
}
void UI_GetThemeColor3fv(int colorid, float col[3])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
col[1] = ((float)cp[1]) / 255.0f;
col[2] = ((float)cp[2]) / 255.0f;
@ -1178,7 +1174,7 @@ void UI_GetThemeColor3fv(int colorid, float col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
col[1] = ((float)cp[1]) / 255.0f;
col[2] = ((float)cp[2]) / 255.0f;
@ -1187,7 +1183,7 @@ void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
col[1] = ((float)cp[1]) / 255.0f;
col[2] = ((float)cp[2]) / 255.0f;
@ -1196,7 +1192,7 @@ void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4])
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
int r, g, b;
r = offset + (int)cp[0];
@ -1213,7 +1209,7 @@ void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
void UI_GetThemeColorShade3ubv(int colorid, int offset, uchar col[3])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
int r, g, b;
r = offset + (int)cp[0];
@ -1231,8 +1227,8 @@ void UI_GetThemeColorShade3ubv(int colorid, int offset, uchar col[3])
void UI_GetThemeColorBlendShade3ubv(
int colorid1, int colorid2, float fac, int offset, uchar col[3])
{
const uchar *cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
const uchar *cp1 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid2);
CLAMP(fac, 0.0f, 1.0f);
@ -1246,7 +1242,7 @@ void UI_GetThemeColorBlendShade3ubv(
void UI_GetThemeColorShade4ubv(int colorid, int offset, uchar col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
int r, g, b;
r = offset + (int)cp[0];
@ -1264,7 +1260,7 @@ void UI_GetThemeColorShade4ubv(int colorid, int offset, uchar col[4])
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
int r, g, b, a;
r = coloffset + (int)cp[0];
@ -1284,8 +1280,8 @@ void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset,
void UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int offset, float col[3])
{
const uchar *cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
const uchar *cp1 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid2);
int r, g, b;
CLAMP(fac, 0.0f, 1.0f);
@ -1304,8 +1300,8 @@ void UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int of
void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
{
const uchar *cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
const uchar *cp1 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid1);
const uchar *cp2 = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid2);
int r, g, b, a;
CLAMP(fac, 0.0f, 1.0f);
@ -1328,7 +1324,7 @@ void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int of
void UI_GetThemeColor3ubv(int colorid, uchar col[3])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
col[0] = cp[0];
col[1] = cp[1];
col[2] = cp[2];
@ -1336,7 +1332,7 @@ void UI_GetThemeColor3ubv(int colorid, uchar col[3])
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
int r, g, b, a;
r = offset + (int)cp[0];
@ -1357,7 +1353,7 @@ void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
void UI_GetThemeColor4ubv(int colorid, uchar col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
col[0] = cp[0];
col[1] = cp[1];
col[2] = cp[2];
@ -1366,7 +1362,7 @@ void UI_GetThemeColor4ubv(int colorid, uchar col[4])
void UI_GetThemeColorType3fv(int colorid, int spacetype, float col[3])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
col[1] = ((float)cp[1]) / 255.0f;
col[2] = ((float)cp[2]) / 255.0f;
@ -1374,7 +1370,7 @@ void UI_GetThemeColorType3fv(int colorid, int spacetype, float col[3])
void UI_GetThemeColorType3ubv(int colorid, int spacetype, uchar col[3])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, spacetype, colorid);
col[0] = cp[0];
col[1] = cp[1];
col[2] = cp[2];
@ -1382,7 +1378,7 @@ void UI_GetThemeColorType3ubv(int colorid, int spacetype, uchar col[3])
void UI_GetThemeColorType4ubv(int colorid, int spacetype, uchar col[4])
{
const uchar *cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, spacetype, colorid);
col[0] = cp[0];
col[1] = cp[1];
col[2] = cp[2];
@ -1397,16 +1393,19 @@ bool UI_GetIconThemeColor4ubv(int colorid, uchar col[4])
if (colorid == TH_ICON_FUND) {
/* Always color development fund icon. */
}
else if (!((theme_spacetype == SPACE_OUTLINER && theme_regionid == RGN_TYPE_WINDOW) ||
(theme_spacetype == SPACE_PROPERTIES && theme_regionid == RGN_TYPE_NAV_BAR) ||
(theme_spacetype == SPACE_FILE && theme_regionid == RGN_TYPE_WINDOW))) {
else if (!((g_theme_state.spacetype == SPACE_OUTLINER &&
g_theme_state.regionid == RGN_TYPE_WINDOW) ||
(g_theme_state.spacetype == SPACE_PROPERTIES &&
g_theme_state.regionid == RGN_TYPE_NAV_BAR) ||
(g_theme_state.spacetype == SPACE_FILE &&
g_theme_state.regionid == RGN_TYPE_WINDOW))) {
/* Only colored icons in specific places, overall UI is intended
* to stay monochrome and out of the way except a few places where it
* is important to communicate different data types. */
return false;
}
const uchar *cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
const uchar *cp = UI_ThemeGetColorPtr(g_theme_state.theme, g_theme_state.spacetype, colorid);
col[0] = cp[0];
col[1] = cp[1];
col[2] = cp[2];

View File

@ -23,7 +23,7 @@
#include "BKE_node_tree_update.h"
#include "BKE_screen.h"
#include "ED_node.h" /* own include */
#include "ED_node.hh" /* own include */
#include "ED_render.h"
#include "ED_screen.h"
#include "ED_space_api.h"

View File

@ -18,7 +18,7 @@
#include "BKE_node_tree_update.h"
#include "BKE_report.h"
#include "ED_node.h"
#include "ED_node.hh"
#include "UI_interface.h"
#include "UI_view2d.h"

View File

@ -75,6 +75,7 @@ struct PointCloudRealizeInfo {
Array<std::optional<GVArraySpan>> attributes;
/** Id attribute on the point cloud. If there are no ids, this #Span is empty. */
Span<float3> positions;
VArray<float> radii;
Span<int> stored_ids;
};
@ -180,6 +181,7 @@ struct AllPointCloudsInfo {
/** Preprocessed data about every original point cloud. This is ordered by #order. */
Array<PointCloudRealizeInfo> realize_info;
bool create_id_attribute = false;
bool create_radius_attribute = false;
};
struct AllMeshesInfo {
@ -622,7 +624,10 @@ static void gather_realize_tasks_recursive(GatherTasksInfo &gather_info,
* \{ */
static OrderedAttributes gather_generic_pointcloud_attributes_to_propagate(
const GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, bool &r_create_id)
const GeometrySet &in_geometry_set,
const RealizeInstancesOptions &options,
bool &r_create_radii,
bool &r_create_id)
{
Vector<GeometryComponentType> src_component_types;
src_component_types.append(GEO_COMPONENT_TYPE_POINT_CLOUD);
@ -635,6 +640,7 @@ static OrderedAttributes gather_generic_pointcloud_attributes_to_propagate(
src_component_types, GEO_COMPONENT_TYPE_POINT_CLOUD, true, attributes_to_propagate);
attributes_to_propagate.remove("position");
r_create_id = attributes_to_propagate.pop_try("id").has_value();
r_create_radii = attributes_to_propagate.pop_try("radius").has_value();
OrderedAttributes ordered_attributes;
for (const auto item : attributes_to_propagate.items()) {
ordered_attributes.ids.add_new(item.key);
@ -663,7 +669,7 @@ static AllPointCloudsInfo preprocess_pointclouds(const GeometrySet &geometry_set
{
AllPointCloudsInfo info;
info.attributes = gather_generic_pointcloud_attributes_to_propagate(
geometry_set, options, info.create_id_attribute);
geometry_set, options, info.create_radius_attribute, info.create_id_attribute);
gather_pointclouds_to_realize(geometry_set, info.order);
info.realize_info.reinitialize(info.order.size());
@ -690,6 +696,9 @@ static AllPointCloudsInfo preprocess_pointclouds(const GeometrySet &geometry_set
pointcloud_info.stored_ids = ids_attribute.varray.get_internal_span().typed<int>();
}
}
if (info.create_radius_attribute) {
pointcloud_info.radii = attributes.lookup_or_default("radius", ATTR_DOMAIN_POINT, 0.01f);
}
const VArray<float3> position_attribute = attributes.lookup_or_default<float3>(
"position", ATTR_DOMAIN_POINT, float3(0));
pointcloud_info.positions = position_attribute.get_internal_span();
@ -702,6 +711,7 @@ static void execute_realize_pointcloud_task(
const RealizePointCloudTask &task,
const OrderedAttributes &ordered_attributes,
MutableSpan<GSpanAttributeWriter> dst_attribute_writers,
MutableSpan<float> all_dst_radii,
MutableSpan<int> all_dst_ids,
MutableSpan<float3> all_dst_positions)
{
@ -717,6 +727,9 @@ static void execute_realize_pointcloud_task(
create_result_ids(
options, pointcloud_info.stored_ids, task.id, all_dst_ids.slice(point_slice));
}
if (!all_dst_radii.is_empty()) {
pointcloud_info.radii.materialize(all_dst_radii.slice(point_slice));
}
copy_generic_attributes_to_result(
pointcloud_info.attributes,
@ -759,6 +772,11 @@ static void execute_realize_pointcloud_tasks(const RealizeInstancesOptions &opti
if (all_pointclouds_info.create_id_attribute) {
point_ids = dst_attributes.lookup_or_add_for_write_only_span<int>("id", ATTR_DOMAIN_POINT);
}
SpanAttributeWriter<float> point_radii;
if (all_pointclouds_info.create_radius_attribute) {
point_radii = dst_attributes.lookup_or_add_for_write_only_span<float>("radius",
ATTR_DOMAIN_POINT);
}
/* Prepare generic output attributes. */
Vector<GSpanAttributeWriter> dst_attribute_writers;
@ -777,6 +795,7 @@ static void execute_realize_pointcloud_tasks(const RealizeInstancesOptions &opti
task,
ordered_attributes,
dst_attribute_writers,
point_radii.span,
point_ids.span,
positions.span);
}
@ -787,6 +806,7 @@ static void execute_realize_pointcloud_tasks(const RealizeInstancesOptions &opti
dst_attribute.finish();
}
positions.finish();
point_radii.finish();
point_ids.finish();
}

View File

@ -3542,6 +3542,10 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->object_to_world[3]);
}
copy_m4_m4(ld->conf.cam_obmat, camera->object_to_world);
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
normalize_v3(ld->conf.cam_obmat[0]);
normalize_v3(ld->conf.cam_obmat[1]);
normalize_v3(ld->conf.cam_obmat[2]);
ld->conf.cam_is_persp = (c->type == CAM_PERSP);
ld->conf.near_clip = c->clip_start + clipping_offset;
@ -3570,6 +3574,10 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
Object *light_obj = lmd->light_contour_object;
copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->object_to_world[3]);
copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->object_to_world);
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
normalize_v3(ld->conf.cam_obmat_secondary[0]);
normalize_v3(ld->conf.cam_obmat_secondary[1]);
normalize_v3(ld->conf.cam_obmat_secondary[2]);
ld->conf.light_reference_available = true;
if (light_obj->type == OB_LAMP) {
ld->conf.cam_is_persp_secondary = ((Light *)light_obj->data)->type != LA_SUN;

View File

@ -87,6 +87,16 @@ BLI_INLINE CacheArchiveHandle *handle_from_archive(ArchiveReader *archive)
return reinterpret_cast<CacheArchiveHandle *>(archive);
}
/* Add the object's path to list of object paths. No duplication is done, callers are
* responsible for ensuring that only unique paths are added to the list.
*/
static void add_object_path(ListBase *object_paths, const IObject &object)
{
CacheObjectPath *abc_path = MEM_cnew<CacheObjectPath>("CacheObjectPath");
BLI_strncpy(abc_path->path, object.getFullName().c_str(), sizeof(abc_path->path));
BLI_addtail(object_paths, abc_path);
}
//#define USE_NURBS
/* NOTE: this function is similar to visit_objects below, need to keep them in
@ -134,11 +144,7 @@ static bool gather_objects_paths(const IObject &object, ListBase *object_paths)
}
if (get_path) {
void *abc_path_void = MEM_callocN(sizeof(CacheObjectPath), "CacheObjectPath");
CacheObjectPath *abc_path = static_cast<CacheObjectPath *>(abc_path_void);
BLI_strncpy(abc_path->path, object.getFullName().c_str(), sizeof(abc_path->path));
BLI_addtail(object_paths, abc_path);
add_object_path(object_paths, object);
}
return parent_is_part_of_this_object;
@ -358,10 +364,7 @@ static std::pair<bool, AbcObjectReader *> visit_object(
readers.push_back(reader);
reader->incref();
CacheObjectPath *abc_path = static_cast<CacheObjectPath *>(
MEM_callocN(sizeof(CacheObjectPath), "CacheObjectPath"));
BLI_strncpy(abc_path->path, full_name.c_str(), sizeof(abc_path->path));
BLI_addtail(&settings.cache_file->object_paths, abc_path);
add_object_path(&settings.cache_file->object_paths, object);
/* We can now assign this reader as parent for our children. */
if (nonclaiming_child_readers.size() + assign_as_parent.size() > 0) {

View File

@ -914,8 +914,9 @@ typedef enum IDRecalcFlag {
ID_RECALC_EDITORS = (1 << 12),
/* ** Update copy on write component. **
* This is most generic tag which should only be used when nothing else
* matches.
*
* This is most generic tag which should only be used when nothing else matches.
* It is not to explicitly mixed in with other recalculation flags.
*/
ID_RECALC_COPY_ON_WRITE = (1 << 13),

View File

@ -139,6 +139,15 @@ typedef struct Mesh {
*/
float smoothresh;
/** Per-mesh settings for voxel remesh. */
float remesh_voxel_size;
float remesh_voxel_adaptivity;
int face_sets_color_seed;
/* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
* default and Face Sets can be used without affecting the color of the mesh. */
int face_sets_color_default;
/**
* User-defined symmetry flag (#eMeshSymmetryType) that causes editing operations to maintain
* symmetrical geometry. Supported by operations such as transform and weight-painting.
@ -191,20 +200,11 @@ typedef struct Mesh {
/* Deprecated size of #fdata. */
int totface;
/** Per-mesh settings for voxel remesh. */
float remesh_voxel_size;
float remesh_voxel_adaptivity;
int face_sets_color_seed;
/* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
* default and Face Sets can be used without affecting the color of the mesh. */
int face_sets_color_default;
char _pad1[4];
/**
* Data that isn't saved in files, including caches of derived data, temporary data to improve
* the editing experience, etc. Runtime data is created when reading files and can be accessed
* the editing experience, etc. The struct is created when reading files and can be accessed
* without null checks, with the exception of some temporary meshes which should allocate and
* free the data if they are passed to functions that expect run-time data.
*/
@ -263,7 +263,7 @@ typedef struct Mesh {
* Explicitly set the cached number of loose edges to zero. This can improve performance
* later on, because finding loose edges lazily can be skipped entirely.
*
* \note To allow setting this status on meshes without changing them, this This does not tag the
* \note To allow setting this status on meshes without changing them, this does not tag the
* cache dirty. If the mesh was changed first, the relevant dirty tags should be called first.
*/
void loose_edges_tag_none() const;

View File

@ -170,6 +170,7 @@ typedef struct bNodeSocket {
bNodeSocketRuntimeHandle *runtime;
#ifdef __cplusplus
bool is_hidden() const;
bool is_available() const;
bool is_multi_input() const;
bool is_input() const;
@ -356,6 +357,8 @@ typedef struct bNode {
/** Lookup socket of this node by its identifier. */
const bNodeSocket &input_by_identifier(blender::StringRef identifier) const;
const bNodeSocket &output_by_identifier(blender::StringRef identifier) const;
bNodeSocket &input_by_identifier(blender::StringRef identifier);
bNodeSocket &output_by_identifier(blender::StringRef identifier);
/** If node is frame, will return all children nodes. */
blender::Span<bNode *> direct_children_in_frame() const;
/** Node tree this node belongs to. */

View File

@ -124,6 +124,11 @@ static void rna_MaterialLineArt_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
}
static char *rna_MaterialLineArt_path(const PointerRNA *UNUSED(ptr))
{
return BLI_strdup("lineart");
}
static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Material *ma = (Material *)ptr->owner_id;
@ -712,6 +717,7 @@ static void rna_def_material_lineart(BlenderRNA *brna)
srna = RNA_def_struct(brna, "MaterialLineArt", NULL);
RNA_def_struct_sdna(srna, "MaterialLineArt");
RNA_def_struct_ui_text(srna, "Material Line Art", "");
RNA_def_struct_path_func(srna, "rna_MaterialLineArt_path");
prop = RNA_def_property(srna, "use_material_mask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_default(prop, 0);

View File

@ -2236,6 +2236,11 @@ static void rna_object_lineart_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id);
}
static char *rna_ObjectLineArt_path(const PointerRNA *UNUSED(ptr))
{
return BLI_strdup("lineart");
}
static bool mesh_symmetry_get_common(PointerRNA *ptr, const eMeshSymmetryType sym)
{
const Object *ob = (Object *)ptr->owner_id;
@ -2934,6 +2939,7 @@ static void rna_def_object_lineart(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ObjectLineArt", NULL);
RNA_def_struct_ui_text(srna, "Object Line Art", "Object line art settings");
RNA_def_struct_sdna(srna, "ObjectLineArt");
RNA_def_struct_path_func(srna, "rna_ObjectLineArt_path");
prop = RNA_def_property(srna, "usage", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_feature_line_usage_items);
@ -3236,6 +3242,7 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "actcol");
RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_funcs(prop,
"rna_Object_active_material_index_get",

View File

@ -999,6 +999,15 @@ static void rna_SpaceView3D_object_type_visibility_update(Main *UNUSED(bmain),
DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
}
static void rna_SpaceView3D_shading_use_compositor_update(Main *UNUSED(bmain),
Scene *UNUSED(scene),
PointerRNA *UNUSED(ptr))
{
/* Nodes may display warnings when the compositor is enabled, so we need a redraw in that case,
* and even when it gets disabled in order to potentially remove the warning. */
WM_main_add_notifier(NC_SPACE | ND_SPACE_NODE, NULL);
}
static void rna_SpaceView3D_region_quadviews_begin(CollectionPropertyIterator *iter,
PointerRNA *ptr)
{
@ -4270,7 +4279,9 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop, "Compositor", "When to preview the compositor output inside the viewport");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING, NULL);
RNA_def_property_update(prop,
NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_SHADING,
"rna_SpaceView3D_shading_use_compositor_update");
}
static void rna_def_space_view3d_overlay(BlenderRNA *brna)

View File

@ -48,6 +48,7 @@ set(SRC
intern/node_exec.cc
intern/node_geometry_exec.cc
intern/node_multi_function.cc
intern/node_register.cc
intern/node_socket.cc
intern/node_socket_declarations.cc
intern/node_util.cc
@ -56,7 +57,6 @@ set(SRC
NOD_common.h
NOD_composite.h
NOD_derived_node_tree.hh
NOD_function.h
NOD_geometry.h
NOD_geometry_exec.hh
NOD_geometry_nodes_lazy_function.hh
@ -65,6 +65,7 @@ set(SRC
NOD_multi_function.hh
NOD_node_declaration.hh
NOD_shader.h
NOD_register.hh
NOD_socket.h
NOD_socket_declarations.hh
NOD_socket_declarations_geometry.hh

View File

@ -13,12 +13,6 @@
extern "C" {
#endif
void register_node_type_frame(void);
void register_node_type_reroute(void);
void register_node_type_group_input(void);
void register_node_type_group_output(void);
/* Internal functions for editor. */
struct bNodeSocket *node_group_find_input_socket(struct bNode *groupnode, const char *identifier);

View File

@ -15,120 +15,6 @@ extern "C" {
extern struct bNodeTreeType *ntreeType_Composite;
/* ****************** types array for all composite nodes ****************** */
void register_node_tree_type_cmp(void);
void register_node_type_cmp_group(void);
void register_node_type_cmp_rlayers(void);
void register_node_type_cmp_image(void);
void register_node_type_cmp_texture(void);
void register_node_type_cmp_value(void);
void register_node_type_cmp_rgb(void);
void register_node_type_cmp_curve_time(void);
void register_node_type_cmp_scene_time(void);
void register_node_type_cmp_movieclip(void);
void register_node_type_cmp_composite(void);
void register_node_type_cmp_viewer(void);
void register_node_type_cmp_splitviewer(void);
void register_node_type_cmp_output_file(void);
void register_node_type_cmp_view_levels(void);
void register_node_type_cmp_curve_rgb(void);
void register_node_type_cmp_mix_rgb(void);
void register_node_type_cmp_hue_sat(void);
void register_node_type_cmp_brightcontrast(void);
void register_node_type_cmp_gamma(void);
void register_node_type_cmp_exposure(void);
void register_node_type_cmp_invert(void);
void register_node_type_cmp_alphaover(void);
void register_node_type_cmp_zcombine(void);
void register_node_type_cmp_colorbalance(void);
void register_node_type_cmp_huecorrect(void);
void register_node_type_cmp_convert_color_space(void);
void register_node_type_cmp_normal(void);
void register_node_type_cmp_curve_vec(void);
void register_node_type_cmp_map_value(void);
void register_node_type_cmp_map_range(void);
void register_node_type_cmp_normalize(void);
void register_node_type_cmp_filter(void);
void register_node_type_cmp_blur(void);
void register_node_type_cmp_dblur(void);
void register_node_type_cmp_bilateralblur(void);
void register_node_type_cmp_vecblur(void);
void register_node_type_cmp_dilateerode(void);
void register_node_type_cmp_inpaint(void);
void register_node_type_cmp_despeckle(void);
void register_node_type_cmp_defocus(void);
void register_node_type_cmp_denoise(void);
void register_node_type_cmp_antialiasing(void);
void register_node_type_cmp_posterize(void);
void register_node_type_cmp_valtorgb(void);
void register_node_type_cmp_rgbtobw(void);
void register_node_type_cmp_setalpha(void);
void register_node_type_cmp_idmask(void);
void register_node_type_cmp_math(void);
void register_node_type_cmp_seprgba(void);
void register_node_type_cmp_combrgba(void);
void register_node_type_cmp_sephsva(void);
void register_node_type_cmp_combhsva(void);
void register_node_type_cmp_sepyuva(void);
void register_node_type_cmp_combyuva(void);
void register_node_type_cmp_sepycca(void);
void register_node_type_cmp_combycca(void);
void register_node_type_cmp_premulkey(void);
void register_node_type_cmp_diff_matte(void);
void register_node_type_cmp_distance_matte(void);
void register_node_type_cmp_chroma_matte(void);
void register_node_type_cmp_color_matte(void);
void register_node_type_cmp_channel_matte(void);
void register_node_type_cmp_color_spill(void);
void register_node_type_cmp_luma_matte(void);
void register_node_type_cmp_doubleedgemask(void);
void register_node_type_cmp_keyingscreen(void);
void register_node_type_cmp_keying(void);
void register_node_type_cmp_cryptomatte(void);
void register_node_type_cmp_cryptomatte_legacy(void);
void register_node_type_cmp_translate(void);
void register_node_type_cmp_rotate(void);
void register_node_type_cmp_scale(void);
void register_node_type_cmp_flip(void);
void register_node_type_cmp_crop(void);
void register_node_type_cmp_displace(void);
void register_node_type_cmp_mapuv(void);
void register_node_type_cmp_transform(void);
void register_node_type_cmp_stabilize2d(void);
void register_node_type_cmp_moviedistortion(void);
void register_node_type_cmp_mask(void);
void register_node_type_cmp_glare(void);
void register_node_type_cmp_tonemap(void);
void register_node_type_cmp_lensdist(void);
void register_node_type_cmp_sunbeams(void);
void register_node_type_cmp_colorcorrection(void);
void register_node_type_cmp_boxmask(void);
void register_node_type_cmp_ellipsemask(void);
void register_node_type_cmp_bokehimage(void);
void register_node_type_cmp_bokehblur(void);
void register_node_type_cmp_switch(void);
void register_node_type_cmp_switch_view(void);
void register_node_type_cmp_pixelate(void);
void register_node_type_cmp_trackpos(void);
void register_node_type_cmp_planetrackdeform(void);
void register_node_type_cmp_cornerpin(void);
void register_node_type_cmp_separate_xyz(void);
void register_node_type_cmp_combine_xyz(void);
void register_node_type_cmp_separate_color(void);
void register_node_type_cmp_combine_color(void);
void node_cmp_rlayers_outputs(struct bNodeTree *ntree, struct bNode *node);
void node_cmp_rlayers_register_pass(struct bNodeTree *ntree,
struct bNode *node,

View File

@ -1,30 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
void register_node_type_fn_align_euler_to_vector(void);
void register_node_type_fn_boolean_math(void);
void register_node_type_fn_combine_color(void);
void register_node_type_fn_compare(void);
void register_node_type_fn_float_to_int(void);
void register_node_type_fn_input_bool(void);
void register_node_type_fn_input_color(void);
void register_node_type_fn_input_int(void);
void register_node_type_fn_input_special_characters(void);
void register_node_type_fn_input_string(void);
void register_node_type_fn_input_vector(void);
void register_node_type_fn_random_value(void);
void register_node_type_fn_replace_string(void);
void register_node_type_fn_rotate_euler(void);
void register_node_type_fn_separate_color(void);
void register_node_type_fn_slice_string(void);
void register_node_type_fn_string_length(void);
void register_node_type_fn_value_to_string(void);
#ifdef __cplusplus
}
#endif

View File

@ -10,163 +10,8 @@ extern "C" {
extern struct bNodeTreeType *ntreeType_Geometry;
void register_node_tree_type_geo(void);
void register_node_type_geo_group(void);
void register_node_type_geo_custom_group(bNodeType *ntype);
void register_node_type_geo_accumulate_field(void);
void register_node_type_geo_attribute_capture(void);
void register_node_type_geo_attribute_domain_size(void);
void register_node_type_geo_attribute_separate_xyz(void);
void register_node_type_geo_attribute_statistic(void);
void register_node_type_geo_boolean(void);
void register_node_type_geo_bounding_box(void);
void register_node_type_geo_collection_info(void);
void register_node_type_geo_convex_hull(void);
void register_node_type_geo_curve_endpoint_selection(void);
void register_node_type_geo_curve_fill(void);
void register_node_type_geo_curve_fillet(void);
void register_node_type_geo_curve_handle_type_selection(void);
void register_node_type_geo_curve_length(void);
void register_node_type_geo_curve_primitive_arc(void);
void register_node_type_geo_curve_primitive_bezier_segment(void);
void register_node_type_geo_curve_primitive_circle(void);
void register_node_type_geo_curve_primitive_line(void);
void register_node_type_geo_curve_primitive_quadratic_bezier(void);
void register_node_type_geo_curve_primitive_quadrilateral(void);
void register_node_type_geo_curve_primitive_spiral(void);
void register_node_type_geo_curve_primitive_star(void);
void register_node_type_geo_curve_resample(void);
void register_node_type_geo_curve_reverse(void);
void register_node_type_geo_curve_sample(void);
void register_node_type_geo_curve_set_handle_type(void);
void register_node_type_geo_curve_spline_parameter(void);
void register_node_type_geo_curve_spline_type(void);
void register_node_type_geo_curve_subdivide(void);
void register_node_type_geo_curve_to_mesh(void);
void register_node_type_geo_curve_to_points(void);
void register_node_type_geo_curve_topology_curve_of_point(void);
void register_node_type_geo_curve_topology_points_of_curve(void);
void register_node_type_geo_curve_trim(void);
void register_node_type_geo_deform_curves_on_surface(void);
void register_node_type_geo_delete_geometry(void);
void register_node_type_geo_distribute_points_in_volume(void);
void register_node_type_geo_distribute_points_on_faces(void);
void register_node_type_geo_dual_mesh(void);
void register_node_type_geo_duplicate_elements(void);
void register_node_type_geo_edge_paths_to_curves(void);
void register_node_type_geo_edge_paths_to_selection(void);
void register_node_type_geo_edge_split(void);
void register_node_type_geo_extrude_mesh(void);
void register_node_type_geo_field_at_index(void);
void register_node_type_geo_flip_faces(void);
void register_node_type_geo_geometry_to_instance(void);
void register_node_type_geo_image_info(void);
void register_node_type_geo_image_texture(void);
void register_node_type_geo_input_curve_handles(void);
void register_node_type_geo_input_curve_tilt(void);
void register_node_type_geo_input_id(void);
void register_node_type_geo_input_index(void);
void register_node_type_geo_input_instance_rotation(void);
void register_node_type_geo_input_instance_scale(void);
void register_node_type_geo_input_material_index(void);
void register_node_type_geo_input_material(void);
void register_node_type_geo_input_mesh_edge_angle(void);
void register_node_type_geo_input_mesh_edge_neighbors(void);
void register_node_type_geo_input_mesh_edge_vertices(void);
void register_node_type_geo_input_mesh_face_area(void);
void register_node_type_geo_input_mesh_face_is_planar(void);
void register_node_type_geo_input_mesh_face_neighbors(void);
void register_node_type_geo_input_mesh_island(void);
void register_node_type_geo_input_mesh_vertex_neighbors(void);
void register_node_type_geo_input_named_attribute(void);
void register_node_type_geo_input_normal(void);
void register_node_type_geo_input_position(void);
void register_node_type_geo_input_radius(void);
void register_node_type_geo_input_scene_time(void);
void register_node_type_geo_input_shade_smooth(void);
void register_node_type_geo_input_shortest_edge_paths(void);
void register_node_type_geo_input_spline_cyclic(void);
void register_node_type_geo_input_spline_length(void);
void register_node_type_geo_input_spline_resolution(void);
void register_node_type_geo_input_tangent(void);
void register_node_type_geo_instance_on_points(void);
void register_node_type_geo_instances_to_points(void);
void register_node_type_geo_interpolate_domain(void);
void register_node_type_geo_is_viewport(void);
void register_node_type_geo_join_geometry(void);
void register_node_type_geo_material_replace(void);
void register_node_type_geo_material_selection(void);
void register_node_type_geo_merge_by_distance(void);
void register_node_type_geo_mesh_face_set_boundaries(void);
void register_node_type_geo_mesh_primitive_circle(void);
void register_node_type_geo_mesh_primitive_cone(void);
void register_node_type_geo_mesh_primitive_cube(void);
void register_node_type_geo_mesh_primitive_cylinder(void);
void register_node_type_geo_mesh_primitive_grid(void);
void register_node_type_geo_mesh_primitive_ico_sphere(void);
void register_node_type_geo_mesh_primitive_line(void);
void register_node_type_geo_mesh_primitive_uv_sphere(void);
void register_node_type_geo_mesh_subdivide(void);
void register_node_type_geo_mesh_to_curve(void);
void register_node_type_geo_mesh_to_points(void);
void register_node_type_geo_mesh_to_volume(void);
void register_node_type_geo_mesh_topology_corners_of_face(void);
void register_node_type_geo_mesh_topology_corners_of_vertex(void);
void register_node_type_geo_mesh_topology_edges_of_corner(void);
void register_node_type_geo_mesh_topology_edges_of_vertex(void);
void register_node_type_geo_mesh_topology_face_of_corner(void);
void register_node_type_geo_mesh_topology_offset_corner_in_face(void);
void register_node_type_geo_mesh_topology_vertex_of_corner(void);
void register_node_type_geo_object_info(void);
void register_node_type_geo_offset_point_in_curve(void);
void register_node_type_geo_points_to_vertices(void);
void register_node_type_geo_points_to_volume(void);
void register_node_type_geo_points(void);
void register_node_type_geo_proximity(void);
void register_node_type_geo_raycast(void);
void register_node_type_geo_realize_instances(void);
void register_node_type_geo_remove_attribute(void);
void register_node_type_geo_rotate_instances(void);
void register_node_type_geo_sample_index(void);
void register_node_type_geo_sample_nearest_surface(void);
void register_node_type_geo_sample_nearest(void);
void register_node_type_geo_sample_uv_surface(void);
void register_node_type_geo_scale_elements(void);
void register_node_type_geo_scale_instances(void);
void register_node_type_geo_select_by_handle_type(void);
void register_node_type_geo_separate_components(void);
void register_node_type_geo_separate_geometry(void);
void register_node_type_geo_self_object(void);
void register_node_type_geo_set_curve_handles(void);
void register_node_type_geo_set_curve_normal(void);
void register_node_type_geo_set_curve_radius(void);
void register_node_type_geo_set_curve_tilt(void);
void register_node_type_geo_set_id(void);
void register_node_type_geo_set_material_index(void);
void register_node_type_geo_set_material(void);
void register_node_type_geo_set_point_radius(void);
void register_node_type_geo_set_position(void);
void register_node_type_geo_set_shade_smooth(void);
void register_node_type_geo_set_spline_cyclic(void);
void register_node_type_geo_set_spline_resolution(void);
void register_node_type_geo_simulation_input(void);
void register_node_type_geo_simulation_output(void);
void register_node_type_geo_store_named_attribute(void);
void register_node_type_geo_string_join(void);
void register_node_type_geo_string_to_curves(void);
void register_node_type_geo_subdivision_surface(void);
void register_node_type_geo_switch(void);
void register_node_type_geo_transform(void);
void register_node_type_geo_translate_instances(void);
void register_node_type_geo_triangulate(void);
void register_node_type_geo_uv_pack_islands(void);
void register_node_type_geo_uv_unwrap(void);
void register_node_type_geo_viewer(void);
void register_node_type_geo_volume_cube(void);
void register_node_type_geo_volume_to_mesh(void);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
void register_nodes();
void register_node_type_frame();
void register_node_type_reroute();
void register_node_type_group_input();
void register_node_type_group_output();
void register_composite_nodes();
void register_function_nodes();
void register_geometry_nodes();
void register_shader_nodes();
void register_texture_nodes();

View File

@ -15,120 +15,6 @@ extern "C" {
extern struct bNodeTreeType *ntreeType_Shader;
/* the type definitions array */
/* ****************** types array for all shaders ****************** */
void register_node_tree_type_sh(void);
void register_node_type_sh_group(void);
void register_node_type_sh_camera(void);
void register_node_type_sh_value(void);
void register_node_type_sh_rgb(void);
void register_node_type_sh_mix_rgb(void);
void register_node_type_sh_mix(void);
void register_node_type_sh_valtorgb(void);
void register_node_type_sh_rgbtobw(void);
void register_node_type_sh_shadertorgb(void);
void register_node_type_sh_normal(void);
void register_node_type_sh_gamma(void);
void register_node_type_sh_brightcontrast(void);
void register_node_type_sh_mapping(void);
void register_node_type_sh_curve_float(void);
void register_node_type_sh_curve_vec(void);
void register_node_type_sh_curve_rgb(void);
void register_node_type_sh_map_range(void);
void register_node_type_sh_clamp(void);
void register_node_type_sh_math(void);
void register_node_type_sh_vect_math(void);
void register_node_type_sh_squeeze(void);
void register_node_type_sh_dynamic(void);
void register_node_type_sh_invert(void);
void register_node_type_sh_sepcolor(void);
void register_node_type_sh_combcolor(void);
void register_node_type_sh_seprgb(void);
void register_node_type_sh_combrgb(void);
void register_node_type_sh_sephsv(void);
void register_node_type_sh_combhsv(void);
void register_node_type_sh_sepxyz(void);
void register_node_type_sh_combxyz(void);
void register_node_type_sh_hue_sat(void);
void register_node_type_sh_tex_brick(void);
void register_node_type_sh_tex_pointdensity(void);
void register_node_type_sh_attribute(void);
void register_node_type_sh_bevel(void);
void register_node_type_sh_displacement(void);
void register_node_type_sh_vector_displacement(void);
void register_node_type_sh_geometry(void);
void register_node_type_sh_light_path(void);
void register_node_type_sh_light_falloff(void);
void register_node_type_sh_object_info(void);
void register_node_type_sh_fresnel(void);
void register_node_type_sh_wireframe(void);
void register_node_type_sh_wavelength(void);
void register_node_type_sh_blackbody(void);
void register_node_type_sh_layer_weight(void);
void register_node_type_sh_tex_coord(void);
void register_node_type_sh_particle_info(void);
void register_node_type_sh_hair_info(void);
void register_node_type_sh_point_info(void);
void register_node_type_sh_volume_info(void);
void register_node_type_sh_script(void);
void register_node_type_sh_normal_map(void);
void register_node_type_sh_tangent(void);
void register_node_type_sh_vector_rotate(void);
void register_node_type_sh_vect_transform(void);
void register_node_type_sh_vertex_color(void);
void register_node_type_sh_ambient_occlusion(void);
void register_node_type_sh_background(void);
void register_node_type_sh_bsdf_diffuse(void);
void register_node_type_sh_bsdf_glossy(void);
void register_node_type_sh_bsdf_glass(void);
void register_node_type_sh_bsdf_refraction(void);
void register_node_type_sh_bsdf_translucent(void);
void register_node_type_sh_bsdf_transparent(void);
void register_node_type_sh_bsdf_velvet(void);
void register_node_type_sh_bsdf_toon(void);
void register_node_type_sh_bsdf_anisotropic(void);
void register_node_type_sh_bsdf_principled(void);
void register_node_type_sh_emission(void);
void register_node_type_sh_holdout(void);
void register_node_type_sh_volume_absorption(void);
void register_node_type_sh_volume_scatter(void);
void register_node_type_sh_volume_principled(void);
void register_node_type_sh_bsdf_hair(void);
void register_node_type_sh_bsdf_hair_principled(void);
void register_node_type_sh_subsurface_scattering(void);
void register_node_type_sh_mix_shader(void);
void register_node_type_sh_add_shader(void);
void register_node_type_sh_uvmap(void);
void register_node_type_sh_uvalongstroke(void);
void register_node_type_sh_eevee_metallic(void);
void register_node_type_sh_eevee_specular(void);
void register_node_type_sh_output_light(void);
void register_node_type_sh_output_material(void);
void register_node_type_sh_output_eevee_material(void);
void register_node_type_sh_output_world(void);
void register_node_type_sh_output_linestyle(void);
void register_node_type_sh_output_aov(void);
void register_node_type_sh_tex_image(void);
void register_node_type_sh_tex_environment(void);
void register_node_type_sh_tex_sky(void);
void register_node_type_sh_tex_voronoi(void);
void register_node_type_sh_tex_gradient(void);
void register_node_type_sh_tex_magic(void);
void register_node_type_sh_tex_wave(void);
void register_node_type_sh_tex_musgrave(void);
void register_node_type_sh_tex_noise(void);
void register_node_type_sh_tex_checker(void);
void register_node_type_sh_bump(void);
void register_node_type_sh_tex_ies(void);
void register_node_type_sh_tex_white_noise(void);
void register_node_type_sh_custom_group(bNodeType *ntype);
struct bNodeTreeExec *ntreeShaderBeginExecTree(struct bNodeTree *ntree);

View File

@ -15,51 +15,6 @@ extern "C" {
extern struct bNodeTreeType *ntreeType_Texture;
/* ****************** types array for all texture nodes ****************** */
void register_node_tree_type_tex(void);
void register_node_type_tex_group(void);
void register_node_type_tex_math(void);
void register_node_type_tex_mix_rgb(void);
void register_node_type_tex_valtorgb(void);
void register_node_type_tex_valtonor(void);
void register_node_type_tex_rgbtobw(void);
void register_node_type_tex_output(void);
void register_node_type_tex_viewer(void);
void register_node_type_tex_checker(void);
void register_node_type_tex_texture(void);
void register_node_type_tex_bricks(void);
void register_node_type_tex_image(void);
void register_node_type_tex_curve_rgb(void);
void register_node_type_tex_curve_time(void);
void register_node_type_tex_invert(void);
void register_node_type_tex_hue_sat(void);
void register_node_type_tex_coord(void);
void register_node_type_tex_distance(void);
void register_node_type_tex_rotate(void);
void register_node_type_tex_translate(void);
void register_node_type_tex_scale(void);
void register_node_type_tex_at(void);
void register_node_type_tex_compose(void);
void register_node_type_tex_decompose(void);
void register_node_type_tex_combine_color(void);
void register_node_type_tex_separate_color(void);
void register_node_type_tex_proc_voronoi(void);
void register_node_type_tex_proc_blend(void);
void register_node_type_tex_proc_magic(void);
void register_node_type_tex_proc_marble(void);
void register_node_type_tex_proc_clouds(void);
void register_node_type_tex_proc_wood(void);
void register_node_type_tex_proc_musgrave(void);
void register_node_type_tex_proc_noise(void);
void register_node_type_tex_proc_stucci(void);
void register_node_type_tex_proc_distnoise(void);
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree);
void ntreeTexEndExecTree(struct bNodeTreeExec *exec);

View File

@ -119,9 +119,11 @@ set(SRC
nodes/node_composite_viewer.cc
nodes/node_composite_zcombine.cc
node_composite_register.cc
node_composite_tree.cc
node_composite_util.cc
node_composite_register.hh
node_composite_util.hh
)

View File

@ -0,0 +1,111 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "NOD_register.hh"
#include "node_composite_register.hh"
void register_composite_nodes()
{
register_node_tree_type_cmp();
register_node_type_cmp_group();
register_node_type_cmp_alphaover();
register_node_type_cmp_antialiasing();
register_node_type_cmp_bilateralblur();
register_node_type_cmp_blur();
register_node_type_cmp_bokehblur();
register_node_type_cmp_bokehimage();
register_node_type_cmp_boxmask();
register_node_type_cmp_brightcontrast();
register_node_type_cmp_channel_matte();
register_node_type_cmp_chroma_matte();
register_node_type_cmp_color_matte();
register_node_type_cmp_color_spill();
register_node_type_cmp_colorbalance();
register_node_type_cmp_colorcorrection();
register_node_type_cmp_combhsva();
register_node_type_cmp_combine_color();
register_node_type_cmp_combine_xyz();
register_node_type_cmp_combrgba();
register_node_type_cmp_combycca();
register_node_type_cmp_combyuva();
register_node_type_cmp_composite();
register_node_type_cmp_convert_color_space();
register_node_type_cmp_cornerpin();
register_node_type_cmp_crop();
register_node_type_cmp_cryptomatte_legacy();
register_node_type_cmp_cryptomatte();
register_node_type_cmp_curve_rgb();
register_node_type_cmp_curve_time();
register_node_type_cmp_curve_vec();
register_node_type_cmp_dblur();
register_node_type_cmp_defocus();
register_node_type_cmp_denoise();
register_node_type_cmp_despeckle();
register_node_type_cmp_diff_matte();
register_node_type_cmp_dilateerode();
register_node_type_cmp_displace();
register_node_type_cmp_distance_matte();
register_node_type_cmp_doubleedgemask();
register_node_type_cmp_ellipsemask();
register_node_type_cmp_exposure();
register_node_type_cmp_filter();
register_node_type_cmp_flip();
register_node_type_cmp_gamma();
register_node_type_cmp_glare();
register_node_type_cmp_hue_sat();
register_node_type_cmp_huecorrect();
register_node_type_cmp_idmask();
register_node_type_cmp_image();
register_node_type_cmp_inpaint();
register_node_type_cmp_invert();
register_node_type_cmp_keying();
register_node_type_cmp_keyingscreen();
register_node_type_cmp_lensdist();
register_node_type_cmp_luma_matte();
register_node_type_cmp_map_range();
register_node_type_cmp_map_value();
register_node_type_cmp_mapuv();
register_node_type_cmp_mask();
register_node_type_cmp_math();
register_node_type_cmp_mix_rgb();
register_node_type_cmp_movieclip();
register_node_type_cmp_moviedistortion();
register_node_type_cmp_normal();
register_node_type_cmp_normalize();
register_node_type_cmp_output_file();
register_node_type_cmp_pixelate();
register_node_type_cmp_planetrackdeform();
register_node_type_cmp_posterize();
register_node_type_cmp_premulkey();
register_node_type_cmp_rgb();
register_node_type_cmp_rgbtobw();
register_node_type_cmp_rlayers();
register_node_type_cmp_rotate();
register_node_type_cmp_scale();
register_node_type_cmp_scene_time();
register_node_type_cmp_separate_color();
register_node_type_cmp_separate_xyz();
register_node_type_cmp_sephsva();
register_node_type_cmp_seprgba();
register_node_type_cmp_sepycca();
register_node_type_cmp_sepyuva();
register_node_type_cmp_setalpha();
register_node_type_cmp_splitviewer();
register_node_type_cmp_stabilize2d();
register_node_type_cmp_sunbeams();
register_node_type_cmp_switch_view();
register_node_type_cmp_switch();
register_node_type_cmp_texture();
register_node_type_cmp_tonemap();
register_node_type_cmp_trackpos();
register_node_type_cmp_transform();
register_node_type_cmp_translate();
register_node_type_cmp_valtorgb();
register_node_type_cmp_value();
register_node_type_cmp_vecblur();
register_node_type_cmp_view_levels();
register_node_type_cmp_viewer();
register_node_type_cmp_zcombine();
}

View File

@ -0,0 +1,106 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
void register_node_tree_type_cmp();
void register_node_type_cmp_group();
void register_node_type_cmp_alphaover();
void register_node_type_cmp_antialiasing();
void register_node_type_cmp_bilateralblur();
void register_node_type_cmp_blur();
void register_node_type_cmp_bokehblur();
void register_node_type_cmp_bokehimage();
void register_node_type_cmp_boxmask();
void register_node_type_cmp_brightcontrast();
void register_node_type_cmp_channel_matte();
void register_node_type_cmp_chroma_matte();
void register_node_type_cmp_color_matte();
void register_node_type_cmp_color_spill();
void register_node_type_cmp_colorbalance();
void register_node_type_cmp_colorcorrection();
void register_node_type_cmp_combhsva();
void register_node_type_cmp_combine_color();
void register_node_type_cmp_combine_xyz();
void register_node_type_cmp_combrgba();
void register_node_type_cmp_combycca();
void register_node_type_cmp_combyuva();
void register_node_type_cmp_composite();
void register_node_type_cmp_convert_color_space();
void register_node_type_cmp_cornerpin();
void register_node_type_cmp_crop();
void register_node_type_cmp_cryptomatte_legacy();
void register_node_type_cmp_cryptomatte();
void register_node_type_cmp_curve_rgb();
void register_node_type_cmp_curve_time();
void register_node_type_cmp_curve_vec();
void register_node_type_cmp_dblur();
void register_node_type_cmp_defocus();
void register_node_type_cmp_denoise();
void register_node_type_cmp_despeckle();
void register_node_type_cmp_diff_matte();
void register_node_type_cmp_dilateerode();
void register_node_type_cmp_displace();
void register_node_type_cmp_distance_matte();
void register_node_type_cmp_doubleedgemask();
void register_node_type_cmp_ellipsemask();
void register_node_type_cmp_exposure();
void register_node_type_cmp_filter();
void register_node_type_cmp_flip();
void register_node_type_cmp_gamma();
void register_node_type_cmp_glare();
void register_node_type_cmp_hue_sat();
void register_node_type_cmp_huecorrect();
void register_node_type_cmp_idmask();
void register_node_type_cmp_image();
void register_node_type_cmp_inpaint();
void register_node_type_cmp_invert();
void register_node_type_cmp_keying();
void register_node_type_cmp_keyingscreen();
void register_node_type_cmp_lensdist();
void register_node_type_cmp_luma_matte();
void register_node_type_cmp_map_range();
void register_node_type_cmp_map_value();
void register_node_type_cmp_mapuv();
void register_node_type_cmp_mask();
void register_node_type_cmp_math();
void register_node_type_cmp_mix_rgb();
void register_node_type_cmp_movieclip();
void register_node_type_cmp_moviedistortion();
void register_node_type_cmp_normal();
void register_node_type_cmp_normalize();
void register_node_type_cmp_output_file();
void register_node_type_cmp_pixelate();
void register_node_type_cmp_planetrackdeform();
void register_node_type_cmp_posterize();
void register_node_type_cmp_premulkey();
void register_node_type_cmp_rgb();
void register_node_type_cmp_rgbtobw();
void register_node_type_cmp_rlayers();
void register_node_type_cmp_rotate();
void register_node_type_cmp_scale();
void register_node_type_cmp_scene_time();
void register_node_type_cmp_separate_color();
void register_node_type_cmp_separate_xyz();
void register_node_type_cmp_sephsva();
void register_node_type_cmp_seprgba();
void register_node_type_cmp_sepycca();
void register_node_type_cmp_sepyuva();
void register_node_type_cmp_setalpha();
void register_node_type_cmp_splitviewer();
void register_node_type_cmp_stabilize2d();
void register_node_type_cmp_sunbeams();
void register_node_type_cmp_switch_view();
void register_node_type_cmp_switch();
void register_node_type_cmp_texture();
void register_node_type_cmp_tonemap();
void register_node_type_cmp_trackpos();
void register_node_type_cmp_transform();
void register_node_type_cmp_translate();
void register_node_type_cmp_valtorgb();
void register_node_type_cmp_value();
void register_node_type_cmp_vecblur();
void register_node_type_cmp_view_levels();
void register_node_type_cmp_viewer();
void register_node_type_cmp_zcombine();

View File

@ -12,6 +12,7 @@
#include "BLT_translation.h"
#include "node_composite_register.hh"
#include "node_util.h"
#include "NOD_composite.h"

View File

@ -853,7 +853,11 @@ class RenderLayerOperation : public NodeOperation {
/* Other output passes are not supported for now, so allocate them as invalid. */
for (const bNodeSocket *output : this->node()->output_sockets()) {
if (!STR_ELEM(output->identifier, "Image", "Alpha")) {
get_result(output->identifier).allocate_invalid();
Result &unsupported_result = get_result(output->identifier);
if (unsupported_result.should_compute()) {
unsupported_result.allocate_invalid();
context().set_info_message("Viewport compositor setup not fully supported");
}
}
}
}

View File

@ -37,8 +37,10 @@ set(SRC
nodes/node_fn_string_length.cc
nodes/node_fn_value_to_string.cc
node_function_register.cc
node_function_util.cc
node_function_register.hh
node_function_util.hh
)

View File

@ -0,0 +1,27 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "NOD_register.hh"
#include "node_function_register.hh"
void register_function_nodes()
{
register_node_type_fn_align_euler_to_vector();
register_node_type_fn_boolean_math();
register_node_type_fn_combine_color();
register_node_type_fn_compare();
register_node_type_fn_float_to_int();
register_node_type_fn_input_bool();
register_node_type_fn_input_color();
register_node_type_fn_input_int();
register_node_type_fn_input_special_characters();
register_node_type_fn_input_string();
register_node_type_fn_input_vector();
register_node_type_fn_random_value();
register_node_type_fn_replace_string();
register_node_type_fn_rotate_euler();
register_node_type_fn_separate_color();
register_node_type_fn_slice_string();
register_node_type_fn_string_length();
register_node_type_fn_value_to_string();
}

View File

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
void register_node_type_fn_align_euler_to_vector();
void register_node_type_fn_boolean_math();
void register_node_type_fn_combine_color();
void register_node_type_fn_compare();
void register_node_type_fn_float_to_int();
void register_node_type_fn_input_bool();
void register_node_type_fn_input_color();
void register_node_type_fn_input_int();
void register_node_type_fn_input_special_characters();
void register_node_type_fn_input_string();
void register_node_type_fn_input_vector();
void register_node_type_fn_random_value();
void register_node_type_fn_replace_string();
void register_node_type_fn_rotate_euler();
void register_node_type_fn_separate_color();
void register_node_type_fn_slice_string();
void register_node_type_fn_string_length();
void register_node_type_fn_value_to_string();

View File

@ -15,10 +15,10 @@
#include "BLT_translation.h"
#include "NOD_function.h"
#include "NOD_multi_function.hh"
#include "NOD_socket_declarations.hh"
#include "node_function_register.hh"
#include "node_util.h"
#include "FN_multi_function_builder.hh"

View File

@ -176,9 +176,11 @@ set(SRC
nodes/node_geo_volume_cube.cc
nodes/node_geo_volume_to_mesh.cc
node_geometry_register.cc
node_geometry_tree.cc
node_geometry_util.cc
node_geometry_register.hh
node_geometry_util.hh
)

View File

@ -0,0 +1,162 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "NOD_register.hh"
#include "node_geometry_register.hh"
void register_geometry_nodes()
{
register_node_tree_type_geo();
register_node_type_geo_group();
register_node_type_geo_accumulate_field();
register_node_type_geo_attribute_capture();
register_node_type_geo_attribute_domain_size();
register_node_type_geo_attribute_statistic();
register_node_type_geo_boolean();
register_node_type_geo_bounding_box();
register_node_type_geo_collection_info();
register_node_type_geo_convex_hull();
register_node_type_geo_curve_endpoint_selection();
register_node_type_geo_curve_fill();
register_node_type_geo_curve_fillet();
register_node_type_geo_curve_handle_type_selection();
register_node_type_geo_curve_length();
register_node_type_geo_curve_primitive_arc();
register_node_type_geo_curve_primitive_bezier_segment();
register_node_type_geo_curve_primitive_circle();
register_node_type_geo_curve_primitive_line();
register_node_type_geo_curve_primitive_quadratic_bezier();
register_node_type_geo_curve_primitive_quadrilateral();
register_node_type_geo_curve_primitive_spiral();
register_node_type_geo_curve_primitive_star();
register_node_type_geo_curve_resample();
register_node_type_geo_curve_reverse();
register_node_type_geo_curve_sample();
register_node_type_geo_curve_set_handle_type();
register_node_type_geo_curve_spline_parameter();
register_node_type_geo_curve_spline_type();
register_node_type_geo_curve_subdivide();
register_node_type_geo_curve_to_mesh();
register_node_type_geo_curve_to_points();
register_node_type_geo_curve_topology_curve_of_point();
register_node_type_geo_curve_topology_points_of_curve();
register_node_type_geo_curve_trim();
register_node_type_geo_deform_curves_on_surface();
register_node_type_geo_delete_geometry();
register_node_type_geo_distribute_points_in_volume();
register_node_type_geo_distribute_points_on_faces();
register_node_type_geo_dual_mesh();
register_node_type_geo_duplicate_elements();
register_node_type_geo_edge_paths_to_curves();
register_node_type_geo_edge_paths_to_selection();
register_node_type_geo_edge_split();
register_node_type_geo_extrude_mesh();
register_node_type_geo_field_at_index();
register_node_type_geo_flip_faces();
register_node_type_geo_geometry_to_instance();
register_node_type_geo_image_info();
register_node_type_geo_image_texture();
register_node_type_geo_input_curve_handles();
register_node_type_geo_input_curve_tilt();
register_node_type_geo_input_id();
register_node_type_geo_input_index();
register_node_type_geo_input_instance_rotation();
register_node_type_geo_input_instance_scale();
register_node_type_geo_input_material_index();
register_node_type_geo_input_material();
register_node_type_geo_input_mesh_edge_angle();
register_node_type_geo_input_mesh_edge_neighbors();
register_node_type_geo_input_mesh_edge_vertices();
register_node_type_geo_input_mesh_face_area();
register_node_type_geo_input_mesh_face_is_planar();
register_node_type_geo_input_mesh_face_neighbors();
register_node_type_geo_input_mesh_island();
register_node_type_geo_input_mesh_vertex_neighbors();
register_node_type_geo_input_named_attribute();
register_node_type_geo_input_normal();
register_node_type_geo_input_position();
register_node_type_geo_input_radius();
register_node_type_geo_input_scene_time();
register_node_type_geo_input_shade_smooth();
register_node_type_geo_input_shortest_edge_paths();
register_node_type_geo_input_spline_cyclic();
register_node_type_geo_input_spline_length();
register_node_type_geo_input_spline_resolution();
register_node_type_geo_input_tangent();
register_node_type_geo_instance_on_points();
register_node_type_geo_instances_to_points();
register_node_type_geo_interpolate_domain();
register_node_type_geo_is_viewport();
register_node_type_geo_join_geometry();
register_node_type_geo_material_replace();
register_node_type_geo_material_selection();
register_node_type_geo_merge_by_distance();
register_node_type_geo_mesh_face_set_boundaries();
register_node_type_geo_mesh_primitive_circle();
register_node_type_geo_mesh_primitive_cone();
register_node_type_geo_mesh_primitive_cube();
register_node_type_geo_mesh_primitive_cylinder();
register_node_type_geo_mesh_primitive_grid();
register_node_type_geo_mesh_primitive_ico_sphere();
register_node_type_geo_mesh_primitive_line();
register_node_type_geo_mesh_primitive_uv_sphere();
register_node_type_geo_mesh_subdivide();
register_node_type_geo_mesh_to_curve();
register_node_type_geo_mesh_to_points();
register_node_type_geo_mesh_to_volume();
register_node_type_geo_mesh_topology_corners_of_face();
register_node_type_geo_mesh_topology_corners_of_vertex();
register_node_type_geo_mesh_topology_edges_of_corner();
register_node_type_geo_mesh_topology_edges_of_vertex();
register_node_type_geo_mesh_topology_face_of_corner();
register_node_type_geo_mesh_topology_offset_corner_in_face();
register_node_type_geo_mesh_topology_vertex_of_corner();
register_node_type_geo_object_info();
register_node_type_geo_offset_point_in_curve();
register_node_type_geo_points_to_vertices();
register_node_type_geo_points_to_volume();
register_node_type_geo_points();
register_node_type_geo_proximity();
register_node_type_geo_raycast();
register_node_type_geo_realize_instances();
register_node_type_geo_remove_attribute();
register_node_type_geo_rotate_instances();
register_node_type_geo_sample_index();
register_node_type_geo_sample_nearest_surface();
register_node_type_geo_sample_nearest();
register_node_type_geo_sample_uv_surface();
register_node_type_geo_scale_elements();
register_node_type_geo_scale_instances();
register_node_type_geo_self_object();
register_node_type_geo_separate_components();
register_node_type_geo_separate_geometry();
register_node_type_geo_set_curve_handles();
register_node_type_geo_set_curve_normal();
register_node_type_geo_set_curve_radius();
register_node_type_geo_set_curve_tilt();
register_node_type_geo_set_id();
register_node_type_geo_set_material_index();
register_node_type_geo_set_material();
register_node_type_geo_set_point_radius();
register_node_type_geo_set_position();
register_node_type_geo_set_shade_smooth();
register_node_type_geo_set_spline_cyclic();
register_node_type_geo_set_spline_resolution();
register_node_type_geo_simulation_input();
register_node_type_geo_simulation_output();
register_node_type_geo_store_named_attribute();
register_node_type_geo_string_join();
register_node_type_geo_string_to_curves();
register_node_type_geo_subdivision_surface();
register_node_type_geo_switch();
register_node_type_geo_transform();
register_node_type_geo_translate_instances();
register_node_type_geo_triangulate();
register_node_type_geo_uv_pack_islands();
register_node_type_geo_uv_unwrap();
register_node_type_geo_viewer();
register_node_type_geo_volume_cube();
register_node_type_geo_volume_to_mesh();
}

View File

@ -0,0 +1,159 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
void register_node_tree_type_geo();
void register_node_type_geo_group();
void register_node_type_geo_accumulate_field();
void register_node_type_geo_attribute_capture();
void register_node_type_geo_attribute_domain_size();
void register_node_type_geo_attribute_separate_xyz();
void register_node_type_geo_attribute_statistic();
void register_node_type_geo_boolean();
void register_node_type_geo_bounding_box();
void register_node_type_geo_collection_info();
void register_node_type_geo_convex_hull();
void register_node_type_geo_curve_endpoint_selection();
void register_node_type_geo_curve_fill();
void register_node_type_geo_curve_fillet();
void register_node_type_geo_curve_handle_type_selection();
void register_node_type_geo_curve_length();
void register_node_type_geo_curve_primitive_arc();
void register_node_type_geo_curve_primitive_bezier_segment();
void register_node_type_geo_curve_primitive_circle();
void register_node_type_geo_curve_primitive_line();
void register_node_type_geo_curve_primitive_quadratic_bezier();
void register_node_type_geo_curve_primitive_quadrilateral();
void register_node_type_geo_curve_primitive_spiral();
void register_node_type_geo_curve_primitive_star();
void register_node_type_geo_curve_resample();
void register_node_type_geo_curve_reverse();
void register_node_type_geo_curve_sample();
void register_node_type_geo_curve_set_handle_type();
void register_node_type_geo_curve_spline_parameter();
void register_node_type_geo_curve_spline_type();
void register_node_type_geo_curve_subdivide();
void register_node_type_geo_curve_to_mesh();
void register_node_type_geo_curve_to_points();
void register_node_type_geo_curve_topology_curve_of_point();
void register_node_type_geo_curve_topology_points_of_curve();
void register_node_type_geo_curve_trim();
void register_node_type_geo_deform_curves_on_surface();
void register_node_type_geo_delete_geometry();
void register_node_type_geo_distribute_points_in_volume();
void register_node_type_geo_distribute_points_on_faces();
void register_node_type_geo_dual_mesh();
void register_node_type_geo_duplicate_elements();
void register_node_type_geo_edge_paths_to_curves();
void register_node_type_geo_edge_paths_to_selection();
void register_node_type_geo_edge_split();
void register_node_type_geo_extrude_mesh();
void register_node_type_geo_field_at_index();
void register_node_type_geo_flip_faces();
void register_node_type_geo_geometry_to_instance();
void register_node_type_geo_image_info();
void register_node_type_geo_image_texture();
void register_node_type_geo_input_curve_handles();
void register_node_type_geo_input_curve_tilt();
void register_node_type_geo_input_id();
void register_node_type_geo_input_index();
void register_node_type_geo_input_instance_rotation();
void register_node_type_geo_input_instance_scale();
void register_node_type_geo_input_material_index();
void register_node_type_geo_input_material();
void register_node_type_geo_input_mesh_edge_angle();
void register_node_type_geo_input_mesh_edge_neighbors();
void register_node_type_geo_input_mesh_edge_vertices();
void register_node_type_geo_input_mesh_face_area();
void register_node_type_geo_input_mesh_face_is_planar();
void register_node_type_geo_input_mesh_face_neighbors();
void register_node_type_geo_input_mesh_island();
void register_node_type_geo_input_mesh_vertex_neighbors();
void register_node_type_geo_input_named_attribute();
void register_node_type_geo_input_normal();
void register_node_type_geo_input_position();
void register_node_type_geo_input_radius();
void register_node_type_geo_input_scene_time();
void register_node_type_geo_input_shade_smooth();
void register_node_type_geo_input_shortest_edge_paths();
void register_node_type_geo_input_spline_cyclic();
void register_node_type_geo_input_spline_length();
void register_node_type_geo_input_spline_resolution();
void register_node_type_geo_input_tangent();
void register_node_type_geo_instance_on_points();
void register_node_type_geo_instances_to_points();
void register_node_type_geo_interpolate_domain();
void register_node_type_geo_is_viewport();
void register_node_type_geo_join_geometry();
void register_node_type_geo_material_replace();
void register_node_type_geo_material_selection();
void register_node_type_geo_merge_by_distance();
void register_node_type_geo_mesh_face_set_boundaries();
void register_node_type_geo_mesh_primitive_circle();
void register_node_type_geo_mesh_primitive_cone();
void register_node_type_geo_mesh_primitive_cube();
void register_node_type_geo_mesh_primitive_cylinder();
void register_node_type_geo_mesh_primitive_grid();
void register_node_type_geo_mesh_primitive_ico_sphere();
void register_node_type_geo_mesh_primitive_line();
void register_node_type_geo_mesh_primitive_uv_sphere();
void register_node_type_geo_mesh_subdivide();
void register_node_type_geo_mesh_to_curve();
void register_node_type_geo_mesh_to_points();
void register_node_type_geo_mesh_to_volume();
void register_node_type_geo_mesh_topology_corners_of_face();
void register_node_type_geo_mesh_topology_corners_of_vertex();
void register_node_type_geo_mesh_topology_edges_of_corner();
void register_node_type_geo_mesh_topology_edges_of_vertex();
void register_node_type_geo_mesh_topology_face_of_corner();
void register_node_type_geo_mesh_topology_offset_corner_in_face();
void register_node_type_geo_mesh_topology_vertex_of_corner();
void register_node_type_geo_object_info();
void register_node_type_geo_offset_point_in_curve();
void register_node_type_geo_points_to_vertices();
void register_node_type_geo_points_to_volume();
void register_node_type_geo_points();
void register_node_type_geo_proximity();
void register_node_type_geo_raycast();
void register_node_type_geo_realize_instances();
void register_node_type_geo_remove_attribute();
void register_node_type_geo_rotate_instances();
void register_node_type_geo_sample_index();
void register_node_type_geo_sample_nearest_surface();
void register_node_type_geo_sample_nearest();
void register_node_type_geo_sample_uv_surface();
void register_node_type_geo_scale_elements();
void register_node_type_geo_scale_instances();
void register_node_type_geo_select_by_handle_type();
void register_node_type_geo_self_object();
void register_node_type_geo_separate_components();
void register_node_type_geo_separate_geometry();
void register_node_type_geo_set_curve_handles();
void register_node_type_geo_set_curve_normal();
void register_node_type_geo_set_curve_radius();
void register_node_type_geo_set_curve_tilt();
void register_node_type_geo_set_id();
void register_node_type_geo_set_material_index();
void register_node_type_geo_set_material();
void register_node_type_geo_set_point_radius();
void register_node_type_geo_set_position();
void register_node_type_geo_set_shade_smooth();
void register_node_type_geo_set_spline_cyclic();
void register_node_type_geo_set_spline_resolution();
void register_node_type_geo_simulation_input();
void register_node_type_geo_simulation_output();
void register_node_type_geo_store_named_attribute();
void register_node_type_geo_string_join();
void register_node_type_geo_string_to_curves();
void register_node_type_geo_subdivision_surface();
void register_node_type_geo_switch();
void register_node_type_geo_transform();
void register_node_type_geo_translate_instances();
void register_node_type_geo_triangulate();
void register_node_type_geo_uv_pack_islands();
void register_node_type_geo_uv_unwrap();
void register_node_type_geo_viewer();
void register_node_type_geo_volume_cube();
void register_node_type_geo_volume_to_mesh();

View File

@ -22,6 +22,7 @@
#include "RNA_access.h"
#include "node_geometry_register.hh"
#include "node_util.h"
struct BVHTreeFromMesh;

View File

@ -30,6 +30,7 @@
#include "MEM_guardedalloc.h"
#include "NOD_common.h"
#include "NOD_register.hh"
#include "node_common.h"
#include "node_util.h"

View File

@ -0,0 +1,65 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "NOD_register.hh"
#include "NOD_socket.h"
#include "BKE_node.h"
#include "ED_node.hh"
#include "BLT_translation.h"
#include "RNA_access.h"
static bool node_undefined_poll(bNodeType * /*ntype*/,
bNodeTree * /*nodetree*/,
const char ** /*r_disabled_hint*/)
{
/* this type can not be added deliberately, it's just a placeholder */
return false;
}
/* register fallback types used for undefined tree, nodes, sockets */
static void register_undefined_types()
{
/* NOTE: these types are not registered in the type hashes,
* they are just used as placeholders in case the actual types are not registered.
*/
NodeTreeTypeUndefined.type = NTREE_UNDEFINED;
strcpy(NodeTreeTypeUndefined.idname, "NodeTreeUndefined");
strcpy(NodeTreeTypeUndefined.ui_name, N_("Undefined"));
strcpy(NodeTreeTypeUndefined.ui_description, N_("Undefined Node Tree Type"));
node_type_base_custom(&NodeTypeUndefined, "NodeUndefined", "Undefined", 0);
NodeTypeUndefined.poll = node_undefined_poll;
BLI_strncpy(NodeSocketTypeUndefined.idname,
"NodeSocketUndefined",
sizeof(NodeSocketTypeUndefined.idname));
/* extra type info for standard socket types */
NodeSocketTypeUndefined.type = SOCK_CUSTOM;
NodeSocketTypeUndefined.subtype = PROP_NONE;
NodeSocketTypeUndefined.use_link_limits_of_type = true;
NodeSocketTypeUndefined.input_link_limit = 0xFFF;
NodeSocketTypeUndefined.output_link_limit = 0xFFF;
}
void register_nodes()
{
register_undefined_types();
register_standard_node_socket_types();
register_node_type_frame();
register_node_type_reroute();
register_node_type_group_input();
register_node_type_group_output();
register_composite_nodes();
register_shader_nodes();
register_texture_nodes();
register_geometry_nodes();
register_function_nodes();
}

View File

@ -120,9 +120,11 @@ set(SRC
nodes/node_shader_wavelength.cc
nodes/node_shader_wireframe.cc
node_shader_register.cc
node_shader_tree.cc
node_shader_util.cc
node_shader_register.hh
node_shader_util.hh
)

View File

@ -0,0 +1,112 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "NOD_register.hh"
#include "node_shader_register.hh"
void register_shader_nodes()
{
register_node_tree_type_sh();
register_node_type_sh_group();
register_node_type_sh_add_shader();
register_node_type_sh_ambient_occlusion();
register_node_type_sh_attribute();
register_node_type_sh_background();
register_node_type_sh_bevel();
register_node_type_sh_blackbody();
register_node_type_sh_brightcontrast();
register_node_type_sh_bsdf_anisotropic();
register_node_type_sh_bsdf_diffuse();
register_node_type_sh_bsdf_glass();
register_node_type_sh_bsdf_glossy();
register_node_type_sh_bsdf_hair_principled();
register_node_type_sh_bsdf_hair();
register_node_type_sh_bsdf_principled();
register_node_type_sh_bsdf_refraction();
register_node_type_sh_bsdf_toon();
register_node_type_sh_bsdf_translucent();
register_node_type_sh_bsdf_transparent();
register_node_type_sh_bsdf_velvet();
register_node_type_sh_bump();
register_node_type_sh_camera();
register_node_type_sh_clamp();
register_node_type_sh_combcolor();
register_node_type_sh_combhsv();
register_node_type_sh_combrgb();
register_node_type_sh_combxyz();
register_node_type_sh_curve_float();
register_node_type_sh_curve_rgb();
register_node_type_sh_curve_vec();
register_node_type_sh_displacement();
register_node_type_sh_eevee_specular();
register_node_type_sh_emission();
register_node_type_sh_fresnel();
register_node_type_sh_gamma();
register_node_type_sh_geometry();
register_node_type_sh_hair_info();
register_node_type_sh_holdout();
register_node_type_sh_hue_sat();
register_node_type_sh_invert();
register_node_type_sh_layer_weight();
register_node_type_sh_light_falloff();
register_node_type_sh_light_path();
register_node_type_sh_map_range();
register_node_type_sh_mapping();
register_node_type_sh_math();
register_node_type_sh_mix_rgb();
register_node_type_sh_mix_shader();
register_node_type_sh_mix();
register_node_type_sh_normal_map();
register_node_type_sh_normal();
register_node_type_sh_object_info();
register_node_type_sh_output_aov();
register_node_type_sh_output_light();
register_node_type_sh_output_linestyle();
register_node_type_sh_output_material();
register_node_type_sh_output_world();
register_node_type_sh_particle_info();
register_node_type_sh_point_info();
register_node_type_sh_rgb();
register_node_type_sh_rgbtobw();
register_node_type_sh_script();
register_node_type_sh_sepcolor();
register_node_type_sh_sephsv();
register_node_type_sh_seprgb();
register_node_type_sh_sepxyz();
register_node_type_sh_shadertorgb();
register_node_type_sh_squeeze();
register_node_type_sh_subsurface_scattering();
register_node_type_sh_tangent();
register_node_type_sh_tex_brick();
register_node_type_sh_tex_checker();
register_node_type_sh_tex_coord();
register_node_type_sh_tex_environment();
register_node_type_sh_tex_gradient();
register_node_type_sh_tex_ies();
register_node_type_sh_tex_image();
register_node_type_sh_tex_magic();
register_node_type_sh_tex_musgrave();
register_node_type_sh_tex_noise();
register_node_type_sh_tex_pointdensity();
register_node_type_sh_tex_sky();
register_node_type_sh_tex_voronoi();
register_node_type_sh_tex_wave();
register_node_type_sh_tex_white_noise();
register_node_type_sh_uvalongstroke();
register_node_type_sh_uvmap();
register_node_type_sh_valtorgb();
register_node_type_sh_value();
register_node_type_sh_vect_math();
register_node_type_sh_vect_transform();
register_node_type_sh_vector_displacement();
register_node_type_sh_vector_rotate();
register_node_type_sh_vertex_color();
register_node_type_sh_volume_absorption();
register_node_type_sh_volume_info();
register_node_type_sh_volume_principled();
register_node_type_sh_volume_scatter();
register_node_type_sh_wavelength();
register_node_type_sh_wireframe();
}

View File

@ -0,0 +1,110 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
void register_node_tree_type_sh();
void register_node_type_sh_group();
void register_node_type_sh_add_shader();
void register_node_type_sh_ambient_occlusion();
void register_node_type_sh_attribute();
void register_node_type_sh_background();
void register_node_type_sh_bevel();
void register_node_type_sh_blackbody();
void register_node_type_sh_brightcontrast();
void register_node_type_sh_bsdf_anisotropic();
void register_node_type_sh_bsdf_diffuse();
void register_node_type_sh_bsdf_glass();
void register_node_type_sh_bsdf_glossy();
void register_node_type_sh_bsdf_hair_principled();
void register_node_type_sh_bsdf_hair();
void register_node_type_sh_bsdf_principled();
void register_node_type_sh_bsdf_refraction();
void register_node_type_sh_bsdf_toon();
void register_node_type_sh_bsdf_translucent();
void register_node_type_sh_bsdf_transparent();
void register_node_type_sh_bsdf_velvet();
void register_node_type_sh_bump();
void register_node_type_sh_camera();
void register_node_type_sh_clamp();
void register_node_type_sh_combcolor();
void register_node_type_sh_combhsv();
void register_node_type_sh_combrgb();
void register_node_type_sh_combxyz();
void register_node_type_sh_curve_float();
void register_node_type_sh_curve_rgb();
void register_node_type_sh_curve_vec();
void register_node_type_sh_displacement();
void register_node_type_sh_dynamic();
void register_node_type_sh_eevee_metallic();
void register_node_type_sh_eevee_specular();
void register_node_type_sh_emission();
void register_node_type_sh_fresnel();
void register_node_type_sh_gamma();
void register_node_type_sh_geometry();
void register_node_type_sh_hair_info();
void register_node_type_sh_holdout();
void register_node_type_sh_hue_sat();
void register_node_type_sh_invert();
void register_node_type_sh_layer_weight();
void register_node_type_sh_light_falloff();
void register_node_type_sh_light_path();
void register_node_type_sh_map_range();
void register_node_type_sh_mapping();
void register_node_type_sh_math();
void register_node_type_sh_mix_rgb();
void register_node_type_sh_mix_shader();
void register_node_type_sh_mix();
void register_node_type_sh_normal_map();
void register_node_type_sh_normal();
void register_node_type_sh_object_info();
void register_node_type_sh_output_aov();
void register_node_type_sh_output_eevee_material();
void register_node_type_sh_output_light();
void register_node_type_sh_output_linestyle();
void register_node_type_sh_output_material();
void register_node_type_sh_output_world();
void register_node_type_sh_particle_info();
void register_node_type_sh_point_info();
void register_node_type_sh_rgb();
void register_node_type_sh_rgbtobw();
void register_node_type_sh_script();
void register_node_type_sh_sepcolor();
void register_node_type_sh_sephsv();
void register_node_type_sh_seprgb();
void register_node_type_sh_sepxyz();
void register_node_type_sh_shadertorgb();
void register_node_type_sh_squeeze();
void register_node_type_sh_subsurface_scattering();
void register_node_type_sh_tangent();
void register_node_type_sh_tex_brick();
void register_node_type_sh_tex_checker();
void register_node_type_sh_tex_coord();
void register_node_type_sh_tex_environment();
void register_node_type_sh_tex_gradient();
void register_node_type_sh_tex_ies();
void register_node_type_sh_tex_image();
void register_node_type_sh_tex_magic();
void register_node_type_sh_tex_musgrave();
void register_node_type_sh_tex_noise();
void register_node_type_sh_tex_pointdensity();
void register_node_type_sh_tex_sky();
void register_node_type_sh_tex_voronoi();
void register_node_type_sh_tex_wave();
void register_node_type_sh_tex_white_noise();
void register_node_type_sh_uvalongstroke();
void register_node_type_sh_uvmap();
void register_node_type_sh_valtorgb();
void register_node_type_sh_value();
void register_node_type_sh_vect_math();
void register_node_type_sh_vect_transform();
void register_node_type_sh_vector_displacement();
void register_node_type_sh_vector_rotate();
void register_node_type_sh_vertex_color();
void register_node_type_sh_volume_absorption();
void register_node_type_sh_volume_info();
void register_node_type_sh_volume_principled();
void register_node_type_sh_volume_scatter();
void register_node_type_sh_wavelength();
void register_node_type_sh_wireframe();

View File

@ -54,6 +54,8 @@
#include "NOD_multi_function.hh"
#include "NOD_shader.h"
#include "NOD_socket_declarations.hh"
#include "node_shader_register.hh"
#include "node_util.h"
#include "RE_pipeline.h"

View File

@ -34,7 +34,8 @@ void register_node_type_sh_squeeze()
static bNodeType ntype;
sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTER);
sh_node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value (Legacy)", NODE_CLASS_CONVERTER);
ntype.gather_link_search_ops = nullptr;
ntype.declare = file_ns::node_declare;
ntype.gpu_fn = file_ns::gpu_shader_squeeze;

View File

@ -47,9 +47,12 @@ set(SRC
nodes/node_texture_valToNor.cc
nodes/node_texture_valToRgb.cc
nodes/node_texture_viewer.cc
node_texture_register.cc
node_texture_tree.cc
node_texture_util.cc
node_texture_register.hh
node_texture_util.hh
)

View File

@ -0,0 +1,48 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "NOD_register.hh"
#include "node_texture_register.hh"
void register_texture_nodes()
{
register_node_tree_type_tex();
register_node_type_tex_group();
register_node_type_tex_at();
register_node_type_tex_bricks();
register_node_type_tex_checker();
register_node_type_tex_combine_color();
register_node_type_tex_compose();
register_node_type_tex_coord();
register_node_type_tex_curve_rgb();
register_node_type_tex_curve_time();
register_node_type_tex_decompose();
register_node_type_tex_distance();
register_node_type_tex_hue_sat();
register_node_type_tex_image();
register_node_type_tex_invert();
register_node_type_tex_math();
register_node_type_tex_mix_rgb();
register_node_type_tex_output();
register_node_type_tex_proc_blend();
register_node_type_tex_proc_clouds();
register_node_type_tex_proc_distnoise();
register_node_type_tex_proc_magic();
register_node_type_tex_proc_marble();
register_node_type_tex_proc_musgrave();
register_node_type_tex_proc_noise();
register_node_type_tex_proc_stucci();
register_node_type_tex_proc_voronoi();
register_node_type_tex_proc_wood();
register_node_type_tex_rgbtobw();
register_node_type_tex_rotate();
register_node_type_tex_scale();
register_node_type_tex_separate_color();
register_node_type_tex_texture();
register_node_type_tex_translate();
register_node_type_tex_valtonor();
register_node_type_tex_valtorgb();
register_node_type_tex_viewer();
}

View File

@ -0,0 +1,43 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
void register_node_tree_type_tex();
void register_node_type_tex_group();
void register_node_type_tex_at();
void register_node_type_tex_bricks();
void register_node_type_tex_checker();
void register_node_type_tex_combine_color();
void register_node_type_tex_compose();
void register_node_type_tex_coord();
void register_node_type_tex_curve_rgb();
void register_node_type_tex_curve_time();
void register_node_type_tex_decompose();
void register_node_type_tex_distance();
void register_node_type_tex_hue_sat();
void register_node_type_tex_image();
void register_node_type_tex_invert();
void register_node_type_tex_math();
void register_node_type_tex_mix_rgb();
void register_node_type_tex_output();
void register_node_type_tex_proc_blend();
void register_node_type_tex_proc_clouds();
void register_node_type_tex_proc_distnoise();
void register_node_type_tex_proc_magic();
void register_node_type_tex_proc_marble();
void register_node_type_tex_proc_musgrave();
void register_node_type_tex_proc_noise();
void register_node_type_tex_proc_stucci();
void register_node_type_tex_proc_voronoi();
void register_node_type_tex_proc_wood();
void register_node_type_tex_rgbtobw();
void register_node_type_tex_rotate();
void register_node_type_tex_scale();
void register_node_type_tex_separate_color();
void register_node_type_tex_texture();
void register_node_type_tex_translate();
void register_node_type_tex_valtonor();
void register_node_type_tex_valtorgb();
void register_node_type_tex_viewer();

View File

@ -37,6 +37,8 @@
#include "BKE_texture.h"
#include "NOD_texture.h"
#include "node_texture_register.hh"
#include "node_util.h"
#include "BLT_translation.h"

View File

@ -2269,7 +2269,7 @@ PyDoc_STRVAR(bpy_bmfaceseq_new_doc,
" Create a new face from a given set of verts.\n"
"\n"
" :arg verts: Sequence of 3 or more verts.\n"
" :type verts: :class:`BMVert`\n"
" :type verts: sequence of :class:`BMVert`\n"
" :arg example: Existing face to initialize settings (optional argument).\n"
" :type example: :class:`BMFace`\n"
" :return: The newly created face.\n"