[Bf-blender-cvs] [1a3681b83c2] temp-ui-cpp: Cleanup: Move interface_intern.hh
Commit: 1a3681b83c28218e2a3f4b6b613fbef78c80edce Author: Hans Goudey Date: Sat Nov 26 00:21:17 2022 -0600 Branches: temp-ui-cpp https://developer.blender.org/rB1a3681b83c28218e2a3f4b6b613fbef78c80edce Cleanup: Move interface_intern.hh The entire interface directory is now compiled as C++ files! === M source/blender/editors/interface/CMakeLists.txt M source/blender/editors/interface/eyedroppers/eyedropper_color.cc M source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc M source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc M source/blender/editors/interface/eyedroppers/eyedropper_depth.cc M source/blender/editors/interface/eyedroppers/eyedropper_driver.cc M source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.cc M source/blender/editors/interface/eyedroppers/interface_eyedropper.cc M source/blender/editors/interface/interface.cc M source/blender/editors/interface/interface_align.cc M source/blender/editors/interface/interface_anim.cc M source/blender/editors/interface/interface_button_group.cc M source/blender/editors/interface/interface_context_menu.cc M source/blender/editors/interface/interface_drag.cc M source/blender/editors/interface/interface_draw.cc M source/blender/editors/interface/interface_handlers.cc M source/blender/editors/interface/interface_icons.cc M source/blender/editors/interface/interface_icons_event.cc R062source/blender/editors/interface/interface_intern.h source/blender/editors/interface/interface_intern.hh M source/blender/editors/interface/interface_layout.cc M source/blender/editors/interface/interface_ops.cc M source/blender/editors/interface/interface_panel.cc M source/blender/editors/interface/interface_query.cc M source/blender/editors/interface/interface_region_color_picker.cc M source/blender/editors/interface/interface_region_hud.cc M source/blender/editors/interface/interface_region_menu_pie.cc M source/blender/editors/interface/interface_region_menu_popup.cc M source/blender/editors/interface/interface_region_popover.cc M source/blender/editors/interface/interface_region_popup.cc M source/blender/editors/interface/interface_region_search.cc M source/blender/editors/interface/interface_region_tooltip.cc M source/blender/editors/interface/interface_style.cc M source/blender/editors/interface/interface_template_asset_view.cc M source/blender/editors/interface/interface_template_list.cc M source/blender/editors/interface/interface_template_search_menu.cc M source/blender/editors/interface/interface_template_search_operator.cc M source/blender/editors/interface/interface_templates.cc M source/blender/editors/interface/interface_undo.cc M source/blender/editors/interface/interface_utils.cc M source/blender/editors/interface/interface_widgets.cc M source/blender/editors/interface/resources.cc M source/blender/editors/interface/view2d.cc M source/blender/editors/interface/view2d_draw.cc M source/blender/editors/interface/views/abstract_view.cc M source/blender/editors/interface/views/abstract_view_item.cc M source/blender/editors/interface/views/grid_view.cc M source/blender/editors/interface/views/interface_view.cc M source/blender/editors/interface/views/tree_view.cc M source/blender/editors/space_buttons/buttons_texture.cc M source/blender/editors/space_node/node_draw.cc M source/blender/editors/space_node/node_templates.cc === diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index ee6a4e3d279..e3c809b6ccd 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -82,7 +82,7 @@ set(SRC views/tree_view.cc eyedroppers/eyedropper_intern.hh - interface_intern.h + interface_intern.hh interface_regions_intern.hh ) diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc index 1e68f8a7aac..7f755d54650 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc @@ -41,7 +41,7 @@ #include "RNA_define.h" -#include "interface_intern.h" +#include "interface_intern.hh" #include "ED_clip.h" #include "ED_image.h" diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc index 910c62d8f18..0f0155529c9 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc +++ b/sourc
[Bf-blender-cvs] [3c2073d8446] temp-ui-cpp: Cleanup: Move interface eyedroppers directory to C++
Commit: 3c2073d8446e1a6c3f9b957739e8c8c5254a8a71 Author: Hans Goudey Date: Sat Nov 26 00:01:49 2022 -0600 Branches: temp-ui-cpp https://developer.blender.org/rB3c2073d8446e1a6c3f9b957739e8c8c5254a8a71 Cleanup: Move interface eyedroppers directory to C++ === M source/blender/editors/interface/CMakeLists.txt R091source/blender/editors/interface/eyedroppers/eyedropper_color.c source/blender/editors/interface/eyedroppers/eyedropper_color.cc R088source/blender/editors/interface/eyedroppers/eyedropper_colorband.c source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc R093source/blender/editors/interface/eyedroppers/eyedropper_datablock.c source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc R090source/blender/editors/interface/eyedroppers/eyedropper_depth.c source/blender/editors/interface/eyedroppers/eyedropper_depth.cc R093source/blender/editors/interface/eyedroppers/eyedropper_driver.c source/blender/editors/interface/eyedroppers/eyedropper_driver.cc R092source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.c source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.cc R095source/blender/editors/interface/eyedroppers/eyedropper_intern.h source/blender/editors/interface/eyedroppers/eyedropper_intern.hh R092source/blender/editors/interface/eyedroppers/interface_eyedropper.c source/blender/editors/interface/eyedroppers/interface_eyedropper.cc === diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 3803c11a1db..ee6a4e3d279 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -27,13 +27,13 @@ set(INC ) set(SRC - eyedroppers/eyedropper_color.c - eyedroppers/eyedropper_colorband.c - eyedroppers/eyedropper_datablock.c - eyedroppers/eyedropper_depth.c - eyedroppers/eyedropper_driver.c - eyedroppers/eyedropper_gpencil_color.c - eyedroppers/interface_eyedropper.c + eyedroppers/eyedropper_color.cc + eyedroppers/eyedropper_colorband.cc + eyedroppers/eyedropper_datablock.cc + eyedroppers/eyedropper_depth.cc + eyedroppers/eyedropper_driver.cc + eyedroppers/eyedropper_gpencil_color.cc + eyedroppers/interface_eyedropper.cc interface.cc interface_align.cc interface_anim.cc @@ -81,7 +81,7 @@ set(SRC views/interface_view.cc views/tree_view.cc - eyedroppers/eyedropper_intern.h + eyedroppers/eyedropper_intern.hh interface_intern.h interface_regions_intern.hh ) diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_color.c b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc similarity index 91% rename from source/blender/editors/interface/eyedroppers/eyedropper_color.c rename to source/blender/editors/interface/eyedroppers/eyedropper_color.cc index 9c430afd5f0..1e68f8a7aac 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_color.c +++ b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc @@ -50,10 +50,10 @@ #include "RE_pipeline.h" -#include "eyedropper_intern.h" +#include "eyedropper_intern.hh" -typedef struct Eyedropper { - struct ColorManagedDisplay *display; +struct Eyedropper { + ColorManagedDisplay *display; PointerRNA ptr; PropertyRNA *prop; @@ -71,23 +71,24 @@ typedef struct Eyedropper { char sample_text[MAX_NAME]; bNode *crypto_node; - struct CryptomatteSession *cryptomatte_session; -} Eyedropper; + CryptomatteSession *cryptomatte_session; +}; static void eyedropper_draw_cb(const wmWindow *window, void *arg) { - Eyedropper *eye = arg; + Eyedropper *eye = static_cast(arg); eyedropper_draw_cursor_text_window(window, eye->sample_text); } static bool eyedropper_init(bContext *C, wmOperator *op) { - Eyedropper *eye = MEM_callocN(sizeof(Eyedropper), __func__); + Eyedropper *eye = MEM_cnew(__func__); uiBut *but = UI_context_active_but_prop_get(C, &eye->ptr, &eye->prop, &eye->index); - const enum PropertySubType prop_subtype = eye->prop ? RNA_property_subtype(eye->prop) : 0; + const enum PropertySubType prop_subtype = eye->prop ? RNA_property_subtype(eye->prop) : +PropertySubType(0); - if ((eye->ptr.data == NULL) || (eye->prop == NULL) || + if ((eye->ptr.data == nullptr) || (eye->prop == nullptr) || (RNA_property_editable(&eye->ptr, eye->prop) == false) || (RNA_property_array_length(&eye->ptr, eye->prop) < 3) || (RNA_property_type(eye->prop) != PROP_FLOAT) || @@ -127,18 +128,18 @@ static bool eyedropper_init(bContext *C, wmOperator *op) static void eyedropper_exit(bContext *C, wmOperator *op) { - Eyedropper *eye = op->customdata; + Eyedropper *eye = static_cast(op->customdata); wmWindow *window = CTX
[Bf-blender-cvs] [1836acbeaca] temp-ui-cpp: Cleanup: Move six more interface files to C++
Commit: 1836acbeacae230bc8fd559cca885cd2857beab7 Author: Hans Goudey Date: Fri Nov 25 23:48:02 2022 -0600 Branches: temp-ui-cpp https://developer.blender.org/rB1836acbeacae230bc8fd559cca885cd2857beab7 Cleanup: Move six more interface files to C++ === M source/blender/editors/interface/CMakeLists.txt R096source/blender/editors/interface/interface_align.c source/blender/editors/interface/interface_align.cc R094source/blender/editors/interface/interface_icons.c source/blender/editors/interface/interface_icons.cc M source/blender/editors/interface/interface_intern.h R088source/blender/editors/interface/interface_layout.c source/blender/editors/interface/interface_layout.cc R089source/blender/editors/interface/interface_templates.c source/blender/editors/interface/interface_templates.cc R096source/blender/editors/interface/interface_widgets.c source/blender/editors/interface/interface_widgets.cc R092source/blender/editors/interface/resources.c source/blender/editors/interface/resources.cc === diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 0bee4b05a3b..4108800c518 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -35,7 +35,7 @@ set(SRC eyedroppers/eyedropper_gpencil_color.c eyedroppers/interface_eyedropper.c interface.cc - interface_align.c + interface_align.cc interface_anim.cc interface_button_group.cc interface_context_menu.cc @@ -44,9 +44,9 @@ set(SRC interface_draw.cc interface_dropboxes.cc interface_handlers.c - interface_icons.c + interface_icons.cc interface_icons_event.cc - interface_layout.c + interface_layout.cc interface_ops.cc interface_panel.cc interface_query.cc @@ -65,11 +65,11 @@ set(SRC interface_template_list.cc interface_template_search_menu.cc interface_template_search_operator.cc - interface_templates.c + interface_templates.cc interface_undo.cc interface_utils.cc - interface_widgets.c - resources.c + interface_widgets.cc + resources.cc view2d.cc view2d_draw.cc view2d_edge_pan.cc diff --git a/source/blender/editors/interface/interface_align.c b/source/blender/editors/interface/interface_align.cc similarity index 96% rename from source/blender/editors/interface/interface_align.c rename to source/blender/editors/interface/interface_align.cc index 3b897e23e35..d7a9f3bce97 100644 --- a/source/blender/editors/interface/interface_align.c +++ b/source/blender/editors/interface/interface_align.cc @@ -41,7 +41,7 @@ * This will probably not work in all possible cases, * but not sure we want to support such exotic cases anyway. */ -typedef struct ButAlign { +struct ButAlign { uiBut *but; /* Neighbor buttons */ @@ -56,7 +56,7 @@ typedef struct ButAlign { /* Flags, used to mark whether we should 'stitch' * the corners of this button with its neighbors' ones. */ char flags[4]; -} ButAlign; +}; /* Side-related enums and flags. */ enum { @@ -168,7 +168,7 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other /* We found an as close or closer neighbor. * If both buttons are alignable, we set them as each other neighbors. * Else, we have an unalignable one, we need to reset the others matching - * neighbor to NULL if its 'proximity distance' + * neighbor to nullptr if its 'proximity distance' * is really lower with current one. * * NOTE: We cannot only execute that piece of code in case we found a @@ -181,10 +181,10 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other butal_other->neighbors[side_opp] = butal; } else if (butal_can_align && (delta < butal->dists[side])) { - butal->neighbors[side] = NULL; + butal->neighbors[side] = nullptr; } else if (butal_other_can_align && (delta < butal_other->dists[side_opp])) { - butal_other->neighbors[side_opp] = NULL; + butal_other->neighbors[side_opp] = nullptr; } butal->dists[side] = butal_other->dists[side_opp] = delta; } @@ -196,10 +196,10 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other const int stitch = STITCH(side); const int stitch_opp = STITCH(side_opp); -if (butal->neighbors[side] == NULL) { +if (butal->neighbors[side] == nullptr) { butal->neighbors[side] = butal_other; } -if (butal_other->neighbors[side_opp] == NULL) { +if (butal_other->neighbors[side_op
[Bf-blender-cvs] [f77be091714] temp-ui-cpp: Merge branch 'master' into temp-ui-cpp
Commit: f77be091714b233f13892f0376147bcbcced4a26 Author: Hans Goudey Date: Sat Nov 26 00:22:11 2022 -0600 Branches: temp-ui-cpp https://developer.blender.org/rBf77be091714b233f13892f0376147bcbcced4a26 Merge branch 'master' into temp-ui-cpp === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a1ea6d64967] temp-ui-cpp: Cleanup: Move interface_handlers.c to C++
Commit: a1ea6d649676bc53d18e15b7eda4d8208a2bd891 Author: Hans Goudey Date: Fri Nov 25 23:48:33 2022 -0600 Branches: temp-ui-cpp https://developer.blender.org/rBa1ea6d649676bc53d18e15b7eda4d8208a2bd891 Cleanup: Move interface_handlers.c to C++ === M source/blender/blenkernel/BKE_blender_undo.h M source/blender/editors/interface/CMakeLists.txt R093source/blender/editors/interface/interface_handlers.c source/blender/editors/interface/interface_handlers.cc M source/blender/editors/interface/interface_intern.h === diff --git a/source/blender/blenkernel/BKE_blender_undo.h b/source/blender/blenkernel/BKE_blender_undo.h index 3003fe2596d..58a57f7618a 100644 --- a/source/blender/blenkernel/BKE_blender_undo.h +++ b/source/blender/blenkernel/BKE_blender_undo.h @@ -5,6 +5,8 @@ * \ingroup bke */ +#include "BKE_undo_system.h" + #ifdef __cplusplus extern "C" { #endif @@ -13,8 +15,6 @@ struct Main; struct MemFileUndoData; struct bContext; -enum eUndoStepDir; - #define BKE_UNDO_STR_MAX 64 struct MemFileUndoData *BKE_memfile_undo_encode(struct Main *bmain, diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 4108800c518..3803c11a1db 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -43,7 +43,7 @@ set(SRC interface_drag.cc interface_draw.cc interface_dropboxes.cc - interface_handlers.c + interface_handlers.cc interface_icons.cc interface_icons_event.cc interface_layout.cc diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.cc similarity index 93% rename from source/blender/editors/interface/interface_handlers.c rename to source/blender/editors/interface/interface_handlers.cc index ac16d41dabe..a9229983995 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.cc @@ -5,12 +5,12 @@ * \ingroup edinterface */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "MEM_guardedalloc.h" @@ -19,6 +19,7 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" +#include "BLI_array.hh" #include "BLI_array_utils.h" #include "BLI_linklist.h" #include "BLI_listbase.h" @@ -149,31 +150,28 @@ /** \name Local Prototypes * \{ */ -static int ui_do_but_EXIT(bContext *C, - uiBut *but, - struct uiHandleButtonData *data, - const wmEvent *event); +static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, const wmEvent *event); static bool ui_but_find_select_in_enum__cmp(const uiBut *but_a, const uiBut *but_b); -static void ui_textedit_string_set(uiBut *but, struct uiHandleButtonData *data, const char *str); +static void ui_textedit_string_set(uiBut *but, uiHandleButtonData *data, const char *str); static void button_tooltip_timer_reset(bContext *C, uiBut *but); static void ui_block_interaction_begin_ensure(bContext *C, uiBlock *block, - struct uiHandleButtonData *data, + uiHandleButtonData *data, const bool is_click); -static struct uiBlockInteraction_Handle *ui_block_interaction_begin(struct bContext *C, -uiBlock *block, -const bool is_click); -static void ui_block_interaction_end(struct bContext *C, +static uiBlockInteraction_Handle *ui_block_interaction_begin(bContext *C, + uiBlock *block, + const bool is_click); +static void ui_block_interaction_end(bContext *C, uiBlockInteraction_CallbackData *callbacks, - struct uiBlockInteraction_Handle *interaction); -static void ui_block_interaction_update(struct bContext *C, + uiBlockInteraction_Handle *interaction); +static void ui_block_interaction_update(bContext *C, uiBlockInteraction_CallbackData *callbacks, -struct uiBlockInteraction_Handle *interaction); +uiBlockInteraction_Handle *interaction); #ifdef USE_KEYNAV_LIMIT -static void ui_mouse_motion_keynav_init(struct uiKeyNavLock *keynav, const wmEvent *event); -static bool ui_mouse_motion_keynav_test(str
[Bf-blender-cvs] [8d269a2488d] master: PyDocs: Fix incorrect data type of bmesh.types.BMFaceSeq.new
Commit: 8d269a2488d69c878cc5685c94fd59a8f1ea3812 Author: Aaron Carlisle Date: Fri Nov 25 19:55:04 2022 -0500 Branches: master https://developer.blender.org/rB8d269a2488d69c878cc5685c94fd59a8f1ea3812 PyDocs: Fix incorrect data type of bmesh.types.BMFaceSeq.new The API documentation of [[ https://docs.blender.org/api/current/bmesh.types.html?highlight=faces#bmesh.types.BMFaceSeq.new | bmesh.types.BMFaceSeq.new ]] indicates that the argument is only `BMVert`. But the correct one is sequence of `BMVert`. This patch fixes this mismatch. Contributed by @Nutti Differential Revision: https://developer.blender.org/D15668 === M source/blender/python/bmesh/bmesh_py_types.c === diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 12267ef5b13..e218c2384f5 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -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" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ed6e1381dc2] master: Cleanup: Avoid using macros to refer to theme global variables
Commit: ed6e1381dc285e6d0f9acc90422029c0524603b4 Author: Hans Goudey Date: Fri Nov 25 17:11:44 2022 -0600 Branches: master https://developer.blender.org/rBed6e1381dc285e6d0f9acc90422029c0524603b4 Cleanup: Avoid using macros to refer to theme global variables Prefer slightly more verbose code to the use of macros where they aren't really necessary and just add indirection. === M source/blender/editors/interface/resources.c === diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 93b94d42d39..f6cd65fc6da 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -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
[Bf-blender-cvs] [afd16c487d5] master: Cleanup: Move four interface files to C++
Commit: afd16c487d594bac5a6e27c44922713b766e5140 Author: Hans Goudey Date: Fri Nov 25 17:09:47 2022 -0600 Branches: master https://developer.blender.org/rBafd16c487d594bac5a6e27c44922713b766e5140 Cleanup: Move four interface files to C++ === M source/blender/editors/interface/CMakeLists.txt R084source/blender/editors/interface/interface_button_group.c source/blender/editors/interface/interface_button_group.cc R090source/blender/editors/interface/interface_context_menu.c source/blender/editors/interface/interface_context_menu.cc R087source/blender/editors/interface/interface_draw.c source/blender/editors/interface/interface_draw.cc R067source/blender/editors/interface/interface_icons_event.c source/blender/editors/interface/interface_icons_event.cc M source/blender/editors/interface/interface_intern.h === diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 56af318b2fa..0bee4b05a3b 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -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 diff --git a/source/blender/editors/interface/interface_button_group.c b/source/blender/editors/interface/interface_button_group.cc similarity index 84% rename from source/blender/editors/interface/interface_button_group.c rename to source/blender/editors/interface/interface_button_group.cc index 18a99f9b5d3..2ce6fbd2147 100644 --- a/source/blender/editors/interface/interface_button_group.c +++ b/source/blender/editors/interface/interface_button_group.cc @@ -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(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(__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(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. */ diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.cc similarity index 90% rename from source/blender/editors/interface/interface_context_menu.c rename to source/blender/editors/interface/interface_context_menu.cc index 7ed9488950e..da7ed892632 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.cc @@ -6,7 +6,7 @@ * Generic context popup menus. */ -#include +#include #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(but->opptr->data)) : + nullptr; return but->optype->idname; } @@ -87,23 +89,23 @@ static const c
[Bf-blender-cvs] [248ee6270b2] master: Cleanup: Remove unnecessary includes
Commit: 248ee6270b27b62b5998e98d724227d75de1d810 Author: Hans Goudey Date: Fri Nov 25 17:10:28 2022 -0600 Branches: master https://developer.blender.org/rB248ee6270b27b62b5998e98d724227d75de1d810 Cleanup: Remove unnecessary includes === M source/blender/editors/interface/interface_icons_event.cc === diff --git a/source/blender/editors/interface/interface_icons_event.cc b/source/blender/editors/interface/interface_icons_event.cc index 690f571a4a7..ec3246c273c 100644 --- a/source/blender/editors/interface/interface_icons_event.cc +++ b/source/blender/editors/interface/interface_icons_event.cc @@ -9,54 +9,14 @@ * Event codes are used as identifiers. */ -#include -#include -#include - -#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" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4696a27c65f] refactor-mesh-uv-map-generic: Fix accidentally committed typo.
Commit: 4696a27c65f58f59cc702b1fe8ad13bc53ecd1c3 Author: Martijn Versteegh Date: Fri Nov 25 23:48:42 2022 +0100 Branches: refactor-mesh-uv-map-generic https://developer.blender.org/rB4696a27c65f58f59cc702b1fe8ad13bc53ecd1c3 Fix accidentally committed typo. === M source/blender/editors/sculpt_paint/paint_image_proj.cc === diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index 45ffdcebc08..fb0191de298 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -4112,7 +4112,7 @@ static void proj_paint_layer_clone_init(ProjPaintState *ps, ProjPaintLayerClone MEM_mallocN(ps->totpoly_eval * sizeof(float(*)[2]), "proj_paint_mtfaces")); if (layer_num != -1) { - mloopuv_clone_base = static_cast < const float(*)[2](CustomData_get_layer_n( + mloopuv_clone_base = static_cast (CustomData_get_layer_n( &ps->me_eval->ldata, CD_PROP_FLOAT2, layer_num)); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4029cdee7b0] master: Merge branch 'blender-v3.4-release'
Commit: 4029cdee7b0fcae20ff4265af0310ce5483bcaae Author: Hans Goudey Date: Fri Nov 25 15:28:48 2022 -0600 Branches: master https://developer.blender.org/rB4029cdee7b0fcae20ff4265af0310ce5483bcaae Merge branch 'blender-v3.4-release' === === diff --cc source/blender/nodes/shader/nodes/node_shader_squeeze.cc index 31965c5e13e,33f6d15abfd..c0fe5a21418 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.cc +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.cc @@@ -34,9 -34,10 +34,10 @@@ 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; - node_type_gpu(&ntype, file_ns::gpu_shader_squeeze); + ntype.gpu_fn = file_ns::gpu_shader_squeeze; nodeRegisterType(&ntype); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [680a0fb23be] blender-v3.4-release: Fix T102752: Missing default radius when joining point clouds
Commit: 680a0fb23be03d57a837daa7ee693c6c51a61535 Author: Hans Goudey Date: Fri Nov 25 15:25:37 2022 -0600 Branches: blender-v3.4-release https://developer.blender.org/rB680a0fb23be03d57a837daa7ee693c6c51a61535 Fix T102752: Missing default radius when joining point clouds Point clouds are meant to use a default radius of 0.01 when there is no radius attribute. The curve to points node can create curves without a radius attribute. This affects joining and the realize instances node. Similar to 30f244d96f16142d4. === M source/blender/geometry/intern/realize_instances.cc === diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc index 2d9c23df348..57a4ae70b5f 100644 --- a/source/blender/geometry/intern/realize_instances.cc +++ b/source/blender/geometry/intern/realize_instances.cc @@ -75,6 +75,7 @@ struct PointCloudRealizeInfo { Array> attributes; /** Id attribute on the point cloud. If there are no ids, this #Span is empty. */ Span positions; + VArray radii; Span stored_ids; }; @@ -180,6 +181,7 @@ struct AllPointCloudsInfo { /** Preprocessed data about every original point cloud. This is ordered by #order. */ Array 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 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(); } } +if (info.create_radius_attribute) { + pointcloud_info.radii = attributes.lookup_or_default("radius", ATTR_DOMAIN_POINT, 0.01f); +} const VArray position_attribute = attributes.lookup_or_default( "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 dst_attribute_writers, +MutableSpan all_dst_radii, MutableSpan all_dst_ids, MutableSpan 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("id", ATTR_DOMAIN_POINT); } + SpanAttributeWriter point_radii; + if (all_pointclouds_info.create_radius_attribute) { +point_radii = dst_attributes.lookup_or_add_for_write_only_span("radius", + ATTR_DOMAIN_POINT); + } /* Prepare generic output attributes. */ Vector dst_attribute_writers; @@ -777,6 +795,7 @@ static void execute_realize_pointcloud_tasks(const RealizeInstancesOptions &opti task,
[Bf-blender-cvs] [ed8fee16ace] blender-v3.4-release: Fix: Hide "Squeeze Value" node from node search
Commit: ed8fee16acea48173b10d399bff7315ff59e2dc1 Author: Hans Goudey Date: Fri Nov 25 14:59:27 2022 -0600 Branches: blender-v3.4-release https://developer.blender.org/rBed8fee16acea48173b10d399bff7315ff59e2dc1 Fix: Hide "Squeeze Value" node from node search Based on discussion in D10891, this node isn't meant to be exposed and may be removed in the future. The fact that it was exposed in search menus was a mistake from the implementation of link-drag-search and bdb57541475f20ccc4. I explicitly removed the link drag search implementation, and added (Legacy) to the node name which hides it from the add node search. === M source/blender/nodes/shader/nodes/node_shader_squeeze.cc === diff --git a/source/blender/nodes/shader/nodes/node_shader_squeeze.cc b/source/blender/nodes/shader/nodes/node_shader_squeeze.cc index 62e21088791..33f6d15abfd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_squeeze.cc +++ b/source/blender/nodes/shader/nodes/node_shader_squeeze.cc @@ -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; node_type_gpu(&ntype, file_ns::gpu_shader_squeeze); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4a0e19e6086] master: Cleanup: Group deprecated mesh DNA fields, improve comments
Commit: 4a0e19e608691fa5165f1a6745a6ad6b49d551e8 Author: Hans Goudey Date: Fri Nov 25 12:54:14 2022 -0600 Branches: master https://developer.blender.org/rB4a0e19e608691fa5165f1a6745a6ad6b49d551e8 Cleanup: Group deprecated mesh DNA fields, improve comments === M source/blender/makesdna/DNA_mesh_types.h === diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 3458fe5b334..870435a 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -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; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5ca69652730] master: Merge branch 'blender-v3.4-release'
Commit: 5ca696527304d47be4221317f193562ea7891710 Author: Brecht Van Lommel Date: Fri Nov 25 18:54:49 2022 +0100 Branches: master https://developer.blender.org/rB5ca696527304d47be4221317f193562ea7891710 Merge branch 'blender-v3.4-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0147e09e0be] blender-v3.4-release: Python Module: add project description for pypi
Commit: 0147e09e0be9f489c4c7f6720dd55dc245a4d454 Author: Brecht Van Lommel Date: Fri Nov 25 14:43:58 2022 +0100 Branches: blender-v3.4-release https://developer.blender.org/rB0147e09e0be9f489c4c7f6720dd55dc245a4d454 Python Module: add project description for pypi === M build_files/utils/make_bpy_wheel.py === diff --git a/build_files/utils/make_bpy_wheel.py b/build_files/utils/make_bpy_wheel.py index 81d267c6e10..dd6663a72fb 100755 --- a/build_files/utils/make_bpy_wheel.py +++ b/build_files/utils/make_bpy_wheel.py @@ -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 pipeline—modeling, 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-committ...@blender.org", ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [762aa998f3d] soc-2022-many-lights-sampling: Recompute theta_u from the point of theta_min for interior nodes in volume
Commit: 762aa998f3d05958519124f1c11f2c74e6184f2f Author: Weizhen Huang Date: Fri Nov 25 18:30:44 2022 +0100 Branches: soc-2022-many-lights-sampling https://developer.blender.org/rB762aa998f3d05958519124f1c11f2c74e6184f2f Recompute theta_u from the point of theta_min for interior nodes in volume === M intern/cycles/kernel/light/tree.h === diff --git a/intern/cycles/kernel/light/tree.h b/intern/cycles/kernel/light/tree.h index fff73a1392c..17c1df99b34 100644 --- a/intern/cycles/kernel/light/tree.h +++ b/intern/cycles/kernel/light/tree.h @@ -38,6 +38,59 @@ ccl_device float light_tree_cos_bounding_box_angle(const float3 bbox_min, return cos_theta_u; } +ccl_device_inline float sin_from_cos(const float c) +{ + return safe_sqrtf(1.0f - sqr(c)); +} + +/* Compute vector v as in Fig .8. P_v is the corresponding point along the ray ccl_device float3 */ +ccl_device float3 compute_v(const float3 centroid, +const float3 P, +const float3 D, +const float3 bcone_axis, +float t, +ccl_private float3 &P_v) +{ + t = fminf(t, 1e12f); + + const float3 unnormalized_v0 = P - centroid; + float len_v0; + const float3 unnormalized_v1 = unnormalized_v0 + D * t; + const float3 v0 = normalize_len(unnormalized_v0, &len_v0); + const float3 v1 = normalize(unnormalized_v1); + + const float3 o0 = v0; + float3 o1, o2; + make_orthonormals_tangent(o0, v1, &o1, &o2); + + const float dot_o0_a = dot(o0, bcone_axis); + const float dot_o1_a = dot(o1, bcone_axis); + const float cos_phi0 = dot_o0_a / sqrtf(sqr(dot_o0_a) + sqr(dot_o1_a)); + + float3 v; + float t_v; + if (dot_o1_a < 0 || dot(v0, v1) > cos_phi0) { +if (dot_o0_a > dot(v1, bcone_axis)) { + v = v0; + t_v = 0.0f; +} +else { + v = v1; + t_v = t; +} + } + else { +const float sin_phi0 = sin_from_cos(cos_phi0); +v = cos_phi0 * o0 + sin_phi0 * o1; +const float cos_phi1 = dot(-v0, D); +const float sin_phi1 = sin_from_cos(cos_phi1); +/* sin(phi_0) / t_v = sin(phi_0 + phi_1) / len_v0 */ +t_v = len_v0 / (cos_phi1 + cos_phi0 / sin_phi0 * sin_phi1); + } + P_v = P + D * t_v; + return v; +} + /* This is the general function for calculating the importance of either a cluster or an emitter. * Both of the specialized functions obtain the necessary data before calling this function. */ template @@ -68,47 +121,26 @@ ccl_device void light_tree_cluster_importance(const float3 N_or_D, * `sample.h` */ const bool in_volume = (dot(N_or_D, N_or_D) < 5e-4f); - if (in_volume_segment) { -const float3 D = N_or_D; -const float3 v0 = -normalize(point_to_centroid); -const float3 v1 = normalize(-point_to_centroid + D * fminf(t, 1e12f)); - -const float3 o0 = v0; -float3 o1, o2; -make_orthonormals_tangent(o0, v1, &o1, &o2); - -const float dot_o0_a = dot(o0, bcone_axis); -const float dot_o1_a = dot(o1, bcone_axis); -const float cos_phi0 = dot_o0_a / sqrtf(sqr(dot_o0_a) + sqr(dot_o1_a)); - -/* Eq. (6) */ -cos_theta = (dot_o1_a < 0 || dot(v0, v1) > cos_phi0) ? -fmaxf(dot_o0_a, dot(v1, bcone_axis)) : /* b_max */ -dot(bcone_axis, cos_phi0 * o0 + safe_sqrtf(1.0f - sqr(cos_phi0)) * o1); - } - else { -cos_theta = dot(bcone_axis, -point_to_centroid); -if (!in_volume) { - const float3 N = N_or_D; - cos_theta_i = has_transmission ? fabsf(dot(point_to_centroid, N)) : - dot(point_to_centroid, N); - sin_theta_i = safe_sqrtf(1.0f - sqr(cos_theta_i)); - - /* cos_min_incidence_angle = cos(max{theta_i - theta_u, 0}) = cos(theta_i') in the paper */ - cos_min_incidence_angle = cos_theta_i > cos_theta_u ? -1.0f : -cos_theta_i * cos_theta_u + sin_theta_i * sin_theta_u; - - /* cos_max_incidence_angle = cos(min{theta_i + theta_u, pi}) */ - cos_max_incidence_angle = fmaxf(cos_theta_i * cos_theta_u - sin_theta_i * sin_theta_u, 0.0f); - - /* If the node is guaranteed to be behind the surface we're sampling, and the surface is - * opaque, then we can give the node an importance of 0 as it contributes nothing to the - * surface. This is more accurate than the bbox test if we are calculating the importance of - * an emitter with radius */ - if (!has_transmission && cos_min_incidence_angle < 0) { -return; - } + cos_theta = dot(bcone_axis, -point_to_centroid); + if (!in_volume_segment && !in_volume) { +const float3 N = N_or_D; +cos_theta_i = has_transmission ? fabsf(dot(point_to_centroid, N)) : dot(point_to_centroid, N); +sin_theta_i = safe_sqrtf(1.0f - sqr(cos_theta_i)); + +/
[Bf-blender-cvs] [f07b09da273] master: Cycles: Improve oneAPI backend support for non-Intel platforms
Commit: f07b09da2739d6a21ed816eba7c2f5e34cd16a14 Author: Nikita Sirgienko Date: Fri Nov 25 15:43:40 2022 +0100 Branches: master https://developer.blender.org/rBf07b09da2739d6a21ed816eba7c2f5e34cd16a14 Cycles: Improve oneAPI backend support for non-Intel platforms === M build_files/cmake/platform/platform_unix.cmake M build_files/cmake/platform/platform_win32.cmake M intern/cycles/device/oneapi/device.cpp === diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 10be375ee0f..3a75fda35a4 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -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() diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 2ec11d708a6..9bad8045946 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -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() diff --git a/intern/cycles/device/oneapi/device.cpp b/intern/cycles/device/oneapi/device.cpp index 66d6f749e30..abd2a63f0ad 100644 --- a/intern/cycles/device/oneapi/device.cpp +++ b/intern/cycles/device/oneapi/device.cpp @@ -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 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f83aa1ae089] master: Fix T102764: Slow change of active material slot
Commit: f83aa1ae089af4af1cdfd88106280adace0ba372 Author: Sergey Sharybin Date: Fri Nov 25 17:24:33 2022 +0100 Branches: master https://developer.blender.org/rBf83aa1ae089af4af1cdfd88106280adace0ba372 Fix T102764: Slow change of active material slot The issue is caused by the combination of the following factors: - There is a driver from custom property to the subdivision surface modifier. - Active material index tags the ID for the copy-on-write update. Dependency graph currently does not fully distinguish between copy-on-write tag and properties-update tag, so the copy-on-write tag makes the dependency graph believe that it is property which actually affects evaluation has been changed. The simple solution is to treat the active material slot index as an interface data which does not need to trigger copy-on-write tag. The possible downside of this solution is that if someone has a driver from this property the driver will stop working. Whether there is such a real-life setup or not is not clear. Is not something advisable to do anyway. Possible alternative would be to introduce more granularity into the way how property tagging is done. This is something that would be nice to implement eventually, but it is a much bigger refactor. Differential Revision: https://developer.blender.org/D16613 === M source/blender/makesrna/intern/rna_object.c === diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index fc0631c7043..4a6f6e2f15e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -3242,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", ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d1c21d56734] master: Fix T102470: Make material LineArt properties animatable.
Commit: d1c21d5673487321b0b9d07e45fc1ddc186d9295 Author: Yiming Wu Date: Fri Nov 25 23:15:05 2022 +0800 Branches: master https://developer.blender.org/rBd1c21d5673487321b0b9d07e45fc1ddc186d9295 Fix T102470: Make material LineArt properties animatable. MaterialLineArt didn't have a path func, now corrected. === M source/blender/makesrna/intern/rna_material.c M source/blender/makesrna/intern/rna_object.c === diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 1616684cb6a..a2fbd81593b 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -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); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1d6b3d5d69e..fc0631c7043 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -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); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b5ca43b2a01] blender-v3.4-release: Fix T102470: Make material LineArt properties animatable.
Commit: b5ca43b2a017c27794627140d35d6a7fbcf455fb Author: Yiming Wu Date: Fri Nov 25 23:15:05 2022 +0800 Branches: blender-v3.4-release https://developer.blender.org/rBb5ca43b2a017c27794627140d35d6a7fbcf455fb Fix T102470: Make material LineArt properties animatable. MaterialLineArt didn't have a path func, now corrected. === M source/blender/makesrna/intern/rna_material.c M source/blender/makesrna/intern/rna_object.c === diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 252d2e657b5..837bf9888f4 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -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; @@ -731,6 +736,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); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1d6b3d5d69e..fc0631c7043 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -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); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [994e3c6ac56] master: Clarify depsgraph API usage in the libraries code
Commit: 994e3c6ac56cc9f4d35832805a31420344d7b9ed Author: Sergey Sharybin Date: Fri Nov 25 15:19:46 2022 +0100 Branches: master https://developer.blender.org/rB994e3c6ac56cc9f4d35832805a31420344d7b9ed Clarify depsgraph API usage in the libraries code Basically copy the information from the commit message of the 03e2f11d48dc directly to the code. This makes the information easier to find when working on the code. === M source/blender/blenkernel/intern/lib_id.c === diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index f60234a684d..11ebd4c93c0 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -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); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [118afe1de3b] master: Fix T101824: Line art flickers when light object has scaling.
Commit: 118afe1de3b7bf6c42b96ad66062dd9f3fdb1399 Author: Yiming Wu Date: Fri Nov 25 21:55:44 2022 +0800 Branches: master https://developer.blender.org/rB118afe1de3b7bf6c42b96ad66062dd9f3fdb1399 Fix T101824: Line art flickers when light object has scaling. Line art doesn't expect light or camera objects to have scaling. === M release/scripts/addons M release/scripts/addons_contrib M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc M source/tools === diff --git a/release/scripts/addons b/release/scripts/addons index 946b62da3f9..bde68da02fd 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 946b62da3f9c93b4add8596aef836bf3a29ea27c +Subproject commit bde68da02fde93968dc11b52d42060ac3b81ed37 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 69b1305f4b7..e6179b3b112 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 69b1305f4b74fbd7e847acc6a5566755b9803d78 +Subproject commit e6179b3b112298e131bbd0faf648bf0d392b6cdd diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc index 277101716ed..2f30f030297 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.cc @@ -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; diff --git a/source/tools b/source/tools index dfa16042bf7..9e33a8678a3 16 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit dfa16042bf7149475ad318d29a8202d969982abb +Subproject commit 9e33a8678a3b97d2fdb833349657c3cc1c04811f ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dad0f37c1e8] blender-v3.4-release: Fix T101824: Line art flickers when light object has scaling.
Commit: dad0f37c1e82cee038c3967598028a00814c1c33 Author: Yiming Wu Date: Fri Nov 25 21:55:44 2022 +0800 Branches: blender-v3.4-release https://developer.blender.org/rBdad0f37c1e82cee038c3967598028a00814c1c33 Fix T101824: Line art flickers when light object has scaling. Line art doesn't expect light or camera objects to have scaling. === M release/scripts/addons M release/scripts/addons_contrib M source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c M source/tools === diff --git a/release/scripts/addons b/release/scripts/addons index 946b62da3f9..bde68da02fd 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 946b62da3f9c93b4add8596aef836bf3a29ea27c +Subproject commit bde68da02fde93968dc11b52d42060ac3b81ed37 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index 69b1305f4b7..e6179b3b112 16 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit 69b1305f4b74fbd7e847acc6a5566755b9803d78 +Subproject commit e6179b3b112298e131bbd0faf648bf0d392b6cdd diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index 4b5c40c0e38..d5d5a8214f5 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -3594,6 +3594,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; @@ -3622,6 +3626,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; diff --git a/source/tools b/source/tools index dfa16042bf7..9e33a8678a3 16 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit dfa16042bf7149475ad318d29a8202d969982abb +Subproject commit 9e33a8678a3b97d2fdb833349657c3cc1c04811f ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ae6e35279f3] master: Clarify comment about ID_RECALC_COPY_ON_WRITE
Commit: ae6e35279f3f84303b51b5b248579afa1bb19225 Author: Sergey Sharybin Date: Fri Nov 25 14:33:32 2022 +0100 Branches: master https://developer.blender.org/rBae6e35279f3f84303b51b5b248579afa1bb19225 Clarify comment about ID_RECALC_COPY_ON_WRITE The copy-on-write is really an implementation detail of the dependency graph. While there are still cases where there is no better tag to be used, the ID_RECALC_COPY_ON_WRITE should not be used in combination with a dedicated tag. For example if location of object changes the proper tag is `ID_RECALC_TRANSFORM`. Tagging with `ID_RECALC_TRANSFORM | ID_RECALC_COPY_ON_WRITE` will seemingly work, but this is not an intended usage. === M source/blender/makesdna/DNA_ID.h === diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index edd70e0f9d7..3feb341b773 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -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), ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [94a98b9365f] temp-vulkan-shader: Copied over GLSL code gen functions from GLShader.
Commit: 94a98b9365f2e1bef3ab0b1ebfa2e1c004afc181 Author: Jeroen Bakker Date: Fri Nov 25 13:59:39 2022 +0100 Branches: temp-vulkan-shader https://developer.blender.org/rB94a98b9365f2e1bef3ab0b1ebfa2e1c004afc181 Copied over GLSL code gen functions from GLShader. === M source/blender/gpu/vulkan/vk_shader.cc === diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc index 43b99882ff0..120abbd91e2 100644 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@ -13,8 +13,423 @@ #include "BLI_string_utils.h" #include "BLI_vector.hh" +using namespace blender::gpu::shader; + namespace blender::gpu { +/* */ +/** \name Create Info + * \{ */ + +static const char *to_string(const Interpolation &interp) +{ + switch (interp) { +case Interpolation::SMOOTH: + return "smooth"; +case Interpolation::FLAT: + return "flat"; +case Interpolation::NO_PERSPECTIVE: + return "noperspective"; +default: + return "unknown"; + } +} + +static const char *to_string(const Type &type) +{ + switch (type) { +case Type::FLOAT: + return "float"; +case Type::VEC2: + return "vec2"; +case Type::VEC3: + return "vec3"; +case Type::VEC4: + return "vec4"; +case Type::MAT3: + return "mat3"; +case Type::MAT4: + return "mat4"; +case Type::UINT: + return "uint"; +case Type::UVEC2: + return "uvec2"; +case Type::UVEC3: + return "uvec3"; +case Type::UVEC4: + return "uvec4"; +case Type::INT: + return "int"; +case Type::IVEC2: + return "ivec2"; +case Type::IVEC3: + return "ivec3"; +case Type::IVEC4: + return "ivec4"; +case Type::BOOL: + return "bool"; +default: + return "unknown"; + } +} + +static const char *to_string(const eGPUTextureFormat &type) +{ + switch (type) { +case GPU_RGBA8UI: + return "rgba8ui"; +case GPU_RGBA8I: + return "rgba8i"; +case GPU_RGBA8: + return "rgba8"; +case GPU_RGBA32UI: + return "rgba32ui"; +case GPU_RGBA32I: + return "rgba32i"; +case GPU_RGBA32F: + return "rgba32f"; +case GPU_RGBA16UI: + return "rgba16ui"; +case GPU_RGBA16I: + return "rgba16i"; +case GPU_RGBA16F: + return "rgba16f"; +case GPU_RGBA16: + return "rgba16"; +case GPU_RG8UI: + return "rg8ui"; +case GPU_RG8I: + return "rg8i"; +case GPU_RG8: + return "rg8"; +case GPU_RG32UI: + return "rg32ui"; +case GPU_RG32I: + return "rg32i"; +case GPU_RG32F: + return "rg32f"; +case GPU_RG16UI: + return "rg16ui"; +case GPU_RG16I: + return "rg16i"; +case GPU_RG16F: + return "rg16f"; +case GPU_RG16: + return "rg16"; +case GPU_R8UI: + return "r8ui"; +case GPU_R8I: + return "r8i"; +case GPU_R8: + return "r8"; +case GPU_R32UI: + return "r32ui"; +case GPU_R32I: + return "r32i"; +case GPU_R32F: + return "r32f"; +case GPU_R16UI: + return "r16ui"; +case GPU_R16I: + return "r16i"; +case GPU_R16F: + return "r16f"; +case GPU_R16: + return "r16"; +case GPU_R11F_G11F_B10F: + return "r11f_g11f_b10f"; +case GPU_RGB10_A2: + return "rgb10_a2"; +default: + return "unknown"; + } +} + +static const char *to_string(const PrimitiveIn &layout) +{ + switch (layout) { +case PrimitiveIn::POINTS: + return "points"; +case PrimitiveIn::LINES: + return "lines"; +case PrimitiveIn::LINES_ADJACENCY: + return "lines_adjacency"; +case PrimitiveIn::TRIANGLES: + return "triangles"; +case PrimitiveIn::TRIANGLES_ADJACENCY: + return "triangles_adjacency"; +default: + return "unknown"; + } +} + +static const char *to_string(const PrimitiveOut &layout) +{ + switch (layout) { +case PrimitiveOut::POINTS: + return "points"; +case PrimitiveOut::LINE_STRIP: + return "line_strip"; +case PrimitiveOut::TRIANGLE_STRIP: + return "triangle_strip"; +default: + return "unknown"; + } +} + +static const char *to_string(const DepthWrite &value) +{ + switch (value) { +case DepthWrite::ANY: + return "depth_any"; +case DepthWrite::GREATER: + return "depth_greater"; +case DepthWrite::LESS: + return "depth_less"; +default: + return "depth_unchanged"; + } +} + +static void print_image_type(std::ostream &os, + const ImageType &type, + const ShaderCreateInfo::Resource::BindType bind_type) +{ + switch (type) { +case ImageType::INT_BUFFER: +case ImageType::INT_1D: +case ImageType::INT_1D_ARRAY: +
[Bf-blender-cvs] [36127e042b9] temp-vulkan-shader: Improve shader log to add correct filenames.
Commit: 36127e042b97616c51987250881f774de12e27e8 Author: Jeroen Bakker Date: Fri Nov 25 14:15:42 2022 +0100 Branches: temp-vulkan-shader https://developer.blender.org/rB36127e042b97616c51987250881f774de12e27e8 Improve shader log to add correct filenames. === M source/blender/gpu/vulkan/vk_shader_log.cc M source/blender/gpu/vulkan/vk_shader_log.hh === diff --git a/source/blender/gpu/vulkan/vk_shader_log.cc b/source/blender/gpu/vulkan/vk_shader_log.cc index 7549f983d9c..4a7d1771c53 100644 --- a/source/blender/gpu/vulkan/vk_shader_log.cc +++ b/source/blender/gpu/vulkan/vk_shader_log.cc @@ -13,7 +13,7 @@ namespace blender::gpu { char *VKLogParser::parse_line(char *log_line, GPULogItem &log_item) { - log_line = skip_name_and_stage(log_line); + log_line = skip_name(log_line); log_line = skip_separators(log_line, ":"); /* Parse error line & char numbers. */ @@ -31,14 +31,9 @@ char *VKLogParser::parse_line(char *log_line, GPULogItem &log_item) return log_line; } -char *VKLogParser::skip_name_and_stage(char *log_line) +char *VKLogParser::skip_name(char *log_line) { - char *name_skip = skip_until(log_line, '.'); - if (name_skip == log_line) { -return log_line; - } - - return skip_until(name_skip, ':'); + return skip_until(log_line, ':'); } char *VKLogParser::skip_severity_keyword(char *log_line, GPULogItem &log_item) diff --git a/source/blender/gpu/vulkan/vk_shader_log.hh b/source/blender/gpu/vulkan/vk_shader_log.hh index cd5bd49e4fb..fb12b7a5039 100644 --- a/source/blender/gpu/vulkan/vk_shader_log.hh +++ b/source/blender/gpu/vulkan/vk_shader_log.hh @@ -10,7 +10,7 @@ class VKLogParser : public GPULogParser { char *parse_line(char *log_line, GPULogItem &log_item) override; protected: - char *skip_name_and_stage(char *log_line); + char *skip_name(char *log_line); char *skip_severity_keyword(char *log_line, GPULogItem &log_item); }; } // namespace blender::gpu \ No newline at end of file ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6422f75088a] master: Merge branch 'blender-v3.4-release'
Commit: 6422f75088aa4a75122633bc3c5fea2386295e70 Author: Miguel Pozo Date: Fri Nov 25 12:44:05 2022 +0100 Branches: master https://developer.blender.org/rB6422f75088aa4a75122633bc3c5fea2386295e70 Merge branch 'blender-v3.4-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b918c079daf] blender-v3.4-release: Fix T101402: EEVEE: Wrong Volume transforms
Commit: b918c079daf591ce95d0951a6914f9d80c69ffcb Author: Miguel Pozo Date: Fri Nov 25 12:43:30 2022 +0100 Branches: blender-v3.4-release https://developer.blender.org/rBb918c079daf591ce95d0951a6914f9d80c69ffcb Fix T101402: EEVEE: Wrong Volume transforms Ensure VolumeUniformPool uses is always incremented when retrieving a buffer in alloc(). Otherwise the same buffer will be retrieved for more than one object when incrementing the pool size. Reviewed By: fclem Maniphest Tasks: T101402 Differential Revision: https://developer.blender.org/D16607 === M source/blender/draw/intern/draw_volume.cc === diff --git a/source/blender/draw/intern/draw_volume.cc b/source/blender/draw/intern/draw_volume.cc index 5c1ce7c3111..78a7fca4e53 100644 --- a/source/blender/draw/intern/draw_volume.cc +++ b/source/blender/draw/intern/draw_volume.cc @@ -56,7 +56,6 @@ struct VolumeUniformBufPool { if (used >= ubos.size()) { VolumeInfosBuf *buf = new VolumeInfosBuf(); ubos.append(buf); - return buf; } return ubos[used++]; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6bc3311410a] master: Fix: Missing node warning when compositor is enabled
Commit: 6bc3311410a8f6033fd8fff6bb9b1d1847b3200b Author: Omar Emara Date: Fri Nov 25 13:15:42 2022 +0200 Branches: master https://developer.blender.org/rB6bc3311410a8f6033fd8fff6bb9b1d1847b3200b Fix: Missing node warning when compositor is enabled If the compositor is enabled or disabled, the node warnings for unsupported nodes is not updated because of a missing redraw. This patch adds that missing redraw in order to make the change immediate. === M source/blender/makesrna/intern/rna_space.c === diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 17c373f2924..3e7ecbc07fb 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -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) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [60ad5f49fae] master: Cleanup: move C++ declarations to separate .hh header
Commit: 60ad5f49fae67d3cc68cc7feede434a9d0a1e666 Author: Jacques Lucke Date: Fri Nov 25 12:18:10 2022 +0100 Branches: master https://developer.blender.org/rB60ad5f49fae67d3cc68cc7feede434a9d0a1e666 Cleanup: move C++ declarations to separate .hh header === M source/blender/editors/include/ED_node.h A source/blender/editors/include/ED_node.hh M source/blender/editors/space_node/node_relationships.cc M source/blender/editors/transform/transform_convert_node.cc === diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 805c5b0b155..3ce972943b5 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -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 ®ion); -/** - * 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 diff --git a/source/blender/editors/include/ED_node.hh b/source/blender/editors/include/ED_node.hh new file mode 100644 index 000..3929f5952e4 --- /dev/null +++ b/source/blender/editors/include/ED_node.hh @@ -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 ®ion); + +/** + * 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 diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index d1b8bd90122..a18b5c83857 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -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" diff --git a/source/blender/editors/transform/transform_convert_node.cc b/source/blender/editors/transform/transform_convert_node.cc index 9b4e257a8c7..446593a6cf8 100644 --- a/source/blender/editors/transform/transform_convert_node.cc +++ b/source/blender/editors/transform/transform_convert_node.cc @@ -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" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [826535979a8] master: Nodes: add non-const utility to find socket by identifier
Commit: 826535979a8b35bcc060159c96d30d3094b9153a Author: Jacques Lucke Date: Fri Nov 25 12:10:56 2022 +0100 Branches: master https://developer.blender.org/rB826535979a8b35bcc060159c96d30d3094b9153a Nodes: add non-const utility to find socket by identifier This does the same as the corresponding const method. === M source/blender/blenkernel/BKE_node_runtime.hh M source/blender/makesdna/DNA_node_types.h === diff --git a/source/blender/blenkernel/BKE_node_runtime.hh b/source/blender/blenkernel/BKE_node_runtime.hh index 9fddd4ec4b9..69e3b8915cc 100644 --- a/source/blender/blenkernel/BKE_node_runtime.hh +++ b/source/blender/blenkernel/BKE_node_runtime.hh @@ -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; diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 616c8b6f141..f014db3a127 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -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 direct_children_in_frame() const; /** Node tree this node belongs to. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7cf192956bb] geometry-nodes-simulation: Move simulation input/output node a bit more into the convex frame
Commit: 7cf192956bbf2d2ae136f9f046e697a0ce350fb5 Author: Jacques Lucke Date: Fri Nov 25 12:04:04 2022 +0100 Branches: geometry-nodes-simulation https://developer.blender.org/rB7cf192956bbf2d2ae136f9f046e697a0ce350fb5 Move simulation input/output node a bit more into the convex frame === M source/blender/editors/space_node/node_draw.cc === diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 7e2d57e1d52..f30c9b0d563 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -3087,10 +3087,10 @@ static void node_draw_sub_context_frames(TreeDrawContext &tree_draw_ctx, rctf rect = totr; BLI_rctf_pad(&rect, padding, padding); if (context_inputs.contains(node)) { -rect.xmin = math::interpolate(rect.xmin, rect.xmax, 0.5f); +rect.xmin = math::interpolate(totr.xmin, totr.xmax, 0.25f); } else if (context_outputs.contains(node)) { -rect.xmax = math::interpolate(rect.xmin, rect.xmax, 0.5f); +rect.xmax = math::interpolate(totr.xmin, totr.xmax, 0.75f); } add_rect_corner_positions(possible_boundary_positions, rect); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [32690cafd16] master: Fix: Missing compositor warning for Render Layers
Commit: 32690cafd164dad5d590c4268d575339fb81fa87 Author: Omar Emara Date: Fri Nov 25 12:57:16 2022 +0200 Branches: master https://developer.blender.org/rB32690cafd164dad5d590c4268d575339fb81fa87 Fix: Missing compositor warning for Render Layers The Render Layers node didn't draw a warning in the viewport when an unsupported pass is used. This patch adds that warning. === M source/blender/nodes/composite/nodes/node_composite_image.cc === diff --git a/source/blender/nodes/composite/nodes/node_composite_image.cc b/source/blender/nodes/composite/nodes/node_composite_image.cc index c49c16941f1..9bfb150205b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.cc +++ b/source/blender/nodes/composite/nodes/node_composite_image.cc @@ -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"); +} } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [64c26d28629] master: Merge branch 'blender-v3.4-release'
Commit: 64c26d28629ad115d5620477969137543a37a7fa Author: Jacques Lucke Date: Fri Nov 25 11:45:01 2022 +0100 Branches: master https://developer.blender.org/rB64c26d28629ad115d5620477969137543a37a7fa Merge branch 'blender-v3.4-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [848dff1e4c6] blender-v3.4-release: Fix: assert when converting between types in geometry nodes
Commit: 848dff1e4c697c1c1d2d539b370768a7c7dc0c46 Author: Jacques Lucke Date: Fri Nov 25 11:44:17 2022 +0100 Branches: blender-v3.4-release https://developer.blender.org/rB848dff1e4c697c1c1d2d539b370768a7c7dc0c46 Fix: assert when converting between types in geometry nodes This bug only affected debug builds. === M source/blender/blenkernel/intern/type_conversions.cc === diff --git a/source/blender/blenkernel/intern/type_conversions.cc b/source/blender/blenkernel/intern/type_conversions.cc index ffc5442af2d..c3d8f84d5c3 100644 --- a/source/blender/blenkernel/intern/type_conversions.cc +++ b/source/blender/blenkernel/intern/type_conversions.cc @@ -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; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f7cf6e957d6] geometry-nodes-simulation: Merge branch 'master' into geometry-nodes-simulation
Commit: f7cf6e957d6416d03b81a0219222c3598ec07b31 Author: Jacques Lucke Date: Fri Nov 25 11:20:53 2022 +0100 Branches: geometry-nodes-simulation https://developer.blender.org/rBf7cf6e957d6416d03b81a0219222c3598ec07b31 Merge branch 'master' into geometry-nodes-simulation === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5ca4e9e5451] temp-vulkan-shader: Added other stages to VKShader.
Commit: 5ca4e9e5451f458df7731565291d3578e1129ee5 Author: Jeroen Bakker Date: Fri Nov 25 10:03:10 2022 +0100 Branches: temp-vulkan-shader https://developer.blender.org/rB5ca4e9e5451f458df7731565291d3578e1129ee5 Added other stages to VKShader. === M source/blender/gpu/intern/gpu_shader_builder.cc M source/blender/gpu/vulkan/vk_shader.cc M source/blender/gpu/vulkan/vk_shader.hh === diff --git a/source/blender/gpu/intern/gpu_shader_builder.cc b/source/blender/gpu/intern/gpu_shader_builder.cc index 877cd1ee406..2a573072249 100644 --- a/source/blender/gpu/intern/gpu_shader_builder.cc +++ b/source/blender/gpu/intern/gpu_shader_builder.cc @@ -103,9 +103,9 @@ int main(int argc, const char *argv[]) }; blender::Vector backends_to_validate; - backends_to_validate.append({"OpenGL", GPU_BACKEND_OPENGL}); + //backends_to_validate.append({"OpenGL", GPU_BACKEND_OPENGL}); #ifdef WITH_METAL_BACKEND - backends_to_validate.append({"Metal", GPU_BACKEND_METAL}); + //backends_to_validate.append({"Metal", GPU_BACKEND_METAL}); #endif #ifdef WITH_VULKAN_BACKEND backends_to_validate.append({"Vulkan", GPU_BACKEND_VULKAN}); diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc index 6067c5e1653..43b99882ff0 100644 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@ -18,6 +18,12 @@ namespace blender::gpu { static const std::string to_stage_name(shaderc_shader_kind stage) { switch (stage) { +case shaderc_vertex_shader: + return std::string("vertex"); +case shaderc_geometry_shader: + return std::string("geometry"); +case shaderc_fragment_shader: + return std::string("fragment"); case shaderc_compute_shader: return std::string("compute"); @@ -98,6 +104,7 @@ VKShader::VKShader(const char *name) : Shader(name) { context_ = VKContext::get(); } + VKShader::~VKShader() { VkDevice device = context_->device_get(); @@ -111,23 +118,30 @@ void VKShader::build_shader_module(MutableSpan sources, shaderc_shader_kind stage, VkShaderModule *r_shader_module) { - BLI_assert_msg(ELEM(stage, shaderc_compute_shader), + BLI_assert_msg(ELEM(stage, + shaderc_vertex_shader, + shaderc_geometry_shader, + shaderc_fragment_shader, + shaderc_compute_shader), "Only forced ShaderC shader kinds are supported."); sources[0] = glsl_patch_get(); Vector spirv_module = compile_glsl_to_spirv(sources, shaderc_compute_shader); build_shader_module(spirv_module, &compute_module_); } -void VKShader::vertex_shader_from_glsl(MutableSpan /*sources*/) +void VKShader::vertex_shader_from_glsl(MutableSpan sources) { + build_shader_module(sources, shaderc_vertex_shader, &vertex_module_); } -void VKShader::geometry_shader_from_glsl(MutableSpan /*sources*/) +void VKShader::geometry_shader_from_glsl(MutableSpan sources) { + build_shader_module(sources, shaderc_geometry_shader, &geometry_module_); } -void VKShader::fragment_shader_from_glsl(MutableSpan /*sources*/) +void VKShader::fragment_shader_from_glsl(MutableSpan sources) { + build_shader_module(sources, shaderc_fragment_shader, &fragment_module_); } void VKShader::compute_shader_from_glsl(MutableSpan sources) diff --git a/source/blender/gpu/vulkan/vk_shader.hh b/source/blender/gpu/vulkan/vk_shader.hh index f1cd25245da..cc4963ac7d5 100644 --- a/source/blender/gpu/vulkan/vk_shader.hh +++ b/source/blender/gpu/vulkan/vk_shader.hh @@ -19,7 +19,10 @@ namespace blender::gpu { class VKShader : public Shader { private: VKContext *context_ = nullptr; - VkShaderModule compute_module_ = nullptr; + VkShaderModule vertex_module_ = VK_NULL_HANDLE; + VkShaderModule geometry_module_ = VK_NULL_HANDLE; + VkShaderModule fragment_module_ = VK_NULL_HANDLE; + VkShaderModule compute_module_ = VK_NULL_HANDLE; public: VKShader(const char *name); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8a3329e72b5] temp-vulkan-shader: Initialize GCaps from VKContext.
Commit: 8a3329e72b588fe22cf314f5b3d2d5ae128072b4 Author: Jeroen Bakker Date: Fri Nov 25 10:00:31 2022 +0100 Branches: temp-vulkan-shader https://developer.blender.org/rB8a3329e72b588fe22cf314f5b3d2d5ae128072b4 Initialize GCaps from VKContext. === M source/blender/gpu/vulkan/vk_backend.cc M source/blender/gpu/vulkan/vk_backend.hh M source/blender/gpu/vulkan/vk_context.cc === diff --git a/source/blender/gpu/vulkan/vk_backend.cc b/source/blender/gpu/vulkan/vk_backend.cc index 040ca6083bf..993f7822496 100644 --- a/source/blender/gpu/vulkan/vk_backend.cc +++ b/source/blender/gpu/vulkan/vk_backend.cc @@ -5,6 +5,7 @@ * \ingroup gpu */ +#include "gpu_capabilities_private.hh" #include "gpu_platform_private.hh" #include "vk_batch.hh" @@ -137,4 +138,11 @@ shaderc::Compiler &VKBackend::get_shaderc_compiler() return shaderc_compiler_; } +void VKBackend::capabilities_init(VKContext &context) +{ + /* Reset all capabilities from previous context. */ + GCaps = {}; + GCaps.compute_shader_support = true; +} + } // namespace blender::gpu \ No newline at end of file diff --git a/source/blender/gpu/vulkan/vk_backend.hh b/source/blender/gpu/vulkan/vk_backend.hh index d4ceb3dcd9d..f883c06ff60 100644 --- a/source/blender/gpu/vulkan/vk_backend.hh +++ b/source/blender/gpu/vulkan/vk_backend.hh @@ -18,6 +18,8 @@ namespace blender::gpu { +class VKContext; + class VKBackend : public GPUBackend { private: shaderc::Compiler shaderc_compiler_; @@ -60,6 +62,8 @@ class VKBackend : public GPUBackend { shaderc::Compiler &get_shaderc_compiler(); + static void capabilities_init(VKContext &context); + private: static void init_platform(); static void platform_exit(); diff --git a/source/blender/gpu/vulkan/vk_context.cc b/source/blender/gpu/vulkan/vk_context.cc index 0bf2d29e124..6013b5eb95c 100644 --- a/source/blender/gpu/vulkan/vk_context.cc +++ b/source/blender/gpu/vulkan/vk_context.cc @@ -7,6 +7,8 @@ #include "vk_context.hh" +#include "vk_backend.hh" + #include "GHOST_C-api.h" namespace blender::gpu { @@ -32,6 +34,8 @@ VKContext::VKContext(void *ghost_window, void *ghost_context) info.device = device_; info.instance = instance_; vmaCreateAllocator(&info, &mem_allocator_); + + VKBackend::capabilities_init(*this); } VKContext::~VKContext() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [74bfeec1a5e] temp-vulkan-shader: Merge branch 'master' into temp-vulkan-shader
Commit: 74bfeec1a5e07dbf4370cf264690712e75a4fc2a Author: Jeroen Bakker Date: Fri Nov 25 09:00:38 2022 +0100 Branches: temp-vulkan-shader https://developer.blender.org/rB74bfeec1a5e07dbf4370cf264690712e75a4fc2a Merge branch 'master' into temp-vulkan-shader === === diff --cc source/blender/gpu/CMakeLists.txt index f0e5fef26a0,2708b0fe084..ced1489ea87 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@@ -197,6 -195,6 +197,7 @@@ set(VULKAN_SR vulkan/vk_index_buffer.cc vulkan/vk_query.cc vulkan/vk_shader.cc ++ vulkan/vk_shader_log.cc vulkan/vk_storage_buffer.cc vulkan/vk_texture.cc vulkan/vk_uniform_buffer.cc @@@ -210,6 -208,6 +211,7 @@@ vulkan/vk_index_buffer.hh vulkan/vk_query.hh vulkan/vk_shader.hh ++ vulkan/vk_shader_log.hh vulkan/vk_storage_buffer.hh vulkan/vk_texture.hh vulkan/vk_uniform_buffer.hh diff --cc source/blender/gpu/vulkan/vk_shader.cc index 2ad19dd25b8,d628f3eb851..6067c5e1653 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@@ -7,63 -7,7 +7,117 @@@ #include "vk_shader.hh" +#include "vk_backend.hh" ++#include "vk_shader_log.hh" + +#include "BLI_string_utils.h" +#include "BLI_vector.hh" + namespace blender::gpu { + - static std::string combine_sources(MutableSpan sources) ++static const std::string to_stage_name(shaderc_shader_kind stage) ++{ ++ switch (stage) { ++case shaderc_compute_shader: ++ return std::string("compute"); ++ ++default: ++ BLI_assert_msg(false, "Do not know how to convert shaderc_shader_kind to stage name."); ++ break; ++ } ++ return std::string("unknown stage"); ++} ++ ++static std::string combine_sources(Span sources) +{ + char *sources_combined = BLI_string_join_arrayN((const char **)sources.data(), sources.size()); + return std::string(sources_combined); +} + - Vector VKShader::compile_glsl_to_spirv(StringRef source, shaderc_shader_kind kind) ++static char *glsl_patch_get() ++{ ++ static char patch[512] = "\0"; ++ if (patch[0] != '\0') { ++return patch; ++ } ++ ++ size_t slen = 0; ++ /* Version need to go first. */ ++ STR_CONCAT(patch, slen, "#version 430\n"); ++ ++ BLI_assert(slen < sizeof(patch)); ++ return patch; ++} ++ ++Vector VKShader::compile_glsl_to_spirv(Span sources, ++ shaderc_shader_kind stage) +{ ++ std::string combined_sources = combine_sources(sources); + VKBackend &backend = static_cast(*VKBackend::get()); + shaderc::Compiler &compiler = backend.get_shaderc_compiler(); + shaderc::CompileOptions options; + - shaderc::SpvCompilationResult module = compiler.CompileGlslToSpv(source, kind, name, options); ++ shaderc::SpvCompilationResult module = compiler.CompileGlslToSpv( ++ combined_sources, stage, name, options); ++ if (module.GetNumErrors() != 0 || module.GetNumWarnings() != 0) { ++std::string log = module.GetErrorMessage(); ++Vector logcstr(log.c_str(), log.c_str() + log.size() + 1); ++ ++VKLogParser parser; ++print_log(sources, ++ logcstr.data(), ++ to_stage_name(stage).c_str(), ++ module.GetCompilationStatus() != shaderc_compilation_status_success, ++ &parser); ++ } + + if (module.GetCompilationStatus() != shaderc_compilation_status_success) { - // TODO(jbakker): error handling. ++return Vector(); + } + + return Vector(module.cbegin(), module.cend()); +} + +void VKShader::build_shader_module(Span spirv_module, VkShaderModule *r_shader_module) +{ + VkShaderModuleCreateInfo create_info = {}; + create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; + create_info.codeSize = spirv_module.size() * sizeof(uint32_t); + create_info.pCode = spirv_module.data(); + + VKContext &context = *static_cast(VKContext::get()); + + VkResult result = vkCreateShaderModule( + context.device_get(), &create_info, nullptr, r_shader_module); + if (result != VK_SUCCESS) { +*r_shader_module = VK_NULL_HANDLE; + } +} + +VKShader::VKShader(const char *name) : Shader(name) +{ + context_ = VKContext::get(); +} +VKShader::~VKShader() +{ + VkDevice device = context_->device_get(); + if (compute_module_ != VK_NULL_HANDLE) { +vkDestroyShaderModule(device, compute_module_, nullptr); +compute_module_ = VK_NULL_HANDLE; + } +} + ++void VKShader::build_shader_module(MutableSpan sources, ++ shaderc_shader_kind stage, ++ VkShaderModule *r_shader_module) ++{ ++ BLI_assert_msg(ELEM(stage, shaderc_compute_shader), ++ "Only forced ShaderC shader kinds are supported."); ++ sources[0] = glsl_patch_get(); ++ Vector spirv_module = compile_glsl_to_spirv(sources, shaderc_compute_shader)
[Bf-blender-cvs] [7d7a39d00bc] temp-vulkan-shader: Make sure that shader compiler doesn't crash when using Vulkan.
Commit: 7d7a39d00bcb207774c25a576ac863dbdf3bcb0f Author: Jeroen Bakker Date: Fri Nov 25 09:24:03 2022 +0100 Branches: temp-vulkan-shader https://developer.blender.org/rB7d7a39d00bcb207774c25a576ac863dbdf3bcb0f Make sure that shader compiler doesn't crash when using Vulkan. === M source/blender/gpu/intern/gpu_context.cc M source/blender/gpu/intern/gpu_init_exit.c M source/blender/gpu/intern/gpu_shader.cc M source/blender/gpu/intern/gpu_shader_builder.cc === diff --git a/source/blender/gpu/intern/gpu_context.cc b/source/blender/gpu/intern/gpu_context.cc index 7e94538892a..0443417a32a 100644 --- a/source/blender/gpu/intern/gpu_context.cc +++ b/source/blender/gpu/intern/gpu_context.cc @@ -321,6 +321,12 @@ eGPUBackendType GPU_backend_get_type() } #endif +#ifdef WITH_VULKAN_BACKEND + if (g_backend && dynamic_cast(g_backend) != nullptr) { +return GPU_BACKEND_VULKAN; + } +#endif + return GPU_BACKEND_NONE; } diff --git a/source/blender/gpu/intern/gpu_init_exit.c b/source/blender/gpu/intern/gpu_init_exit.c index 2dbb4b215bb..af906ad685f 100644 --- a/source/blender/gpu/intern/gpu_init_exit.c +++ b/source/blender/gpu/intern/gpu_init_exit.c @@ -34,13 +34,13 @@ void GPU_init(void) gpu_shader_create_info_init(); gpu_codegen_init(); - - gpu_batch_init(); + // TODO(jbakker): this should never land in master. + // gpu_batch_init(); } void GPU_exit(void) { - gpu_batch_exit(); + // gpu_batch_exit(); gpu_codegen_exit(); diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc index 4d059ae495e..15d2b37e0a9 100644 --- a/source/blender/gpu/intern/gpu_shader.cc +++ b/source/blender/gpu/intern/gpu_shader.cc @@ -98,6 +98,9 @@ static void standard_defines(Vector &sources) case GPU_BACKEND_METAL: sources.append("#define GPU_METAL\n"); break; +case GPU_BACKEND_VULKAN: + sources.append("#define GPU_VULKAN\n"); + break; default: BLI_assert(false && "Invalid GPU Backend Type"); break; diff --git a/source/blender/gpu/intern/gpu_shader_builder.cc b/source/blender/gpu/intern/gpu_shader_builder.cc index 96e3eacd6f5..877cd1ee406 100644 --- a/source/blender/gpu/intern/gpu_shader_builder.cc +++ b/source/blender/gpu/intern/gpu_shader_builder.cc @@ -54,6 +54,12 @@ void ShaderBuilder::init() break; #endif +#ifdef WITH_VULKAN_BACKEND +case GPU_BACKEND_VULKAN: + glSettings.context_type = GHOST_kDrawingContextTypeVulkan; + break; +#endif + default: BLI_assert_unreachable(); break; @@ -100,6 +106,9 @@ int main(int argc, const char *argv[]) backends_to_validate.append({"OpenGL", GPU_BACKEND_OPENGL}); #ifdef WITH_METAL_BACKEND backends_to_validate.append({"Metal", GPU_BACKEND_METAL}); +#endif +#ifdef WITH_VULKAN_BACKEND + backends_to_validate.append({"Vulkan", GPU_BACKEND_VULKAN}); #endif for (NamedBackend &backend : backends_to_validate) { GPU_backend_type_selection_set(backend.backend); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs