Commit: e53a8f9c51d4b4d6e92652bdf371a6215ff1fe83 Author: Joseph Eagar Date: Sat Dec 3 03:26:49 2022 -0800 Branches: sculpt-dev https://developer.blender.org/rBe53a8f9c51d4b4d6e92652bdf371a6215ff1fe83
Merge branch 'master' into sculpt-dev =================================================================== =================================================================== diff --cc release/scripts/addons index 5a818af9508,0b0052bd53a..fdfd24de034 --- a/release/scripts/addons +++ b/release/scripts/addons @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 5a818af95080cccf04dfa8317f0e966bff515c64 -Subproject commit 0b0052bd53ad8249ed07dfb87705c338af698bde ++Subproject commit fdfd24de034d4bba4fb67731d0aae81dc4940239 diff --cc release/scripts/startup/bl_ui/properties_data_mesh.py index 6d676a4ee18,5d7e7cd77b1..56252ff113a --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@@ -535,13 -536,8 +537,10 @@@ class MESH_UL_attributes(UIList) flags = [] indices = [i for i in range(len(attributes))] + show_all = _context.tool_settings.save_temp_layers if hasattr(_context, "tool_settings") else False + for item in attributes: - if show_all: - flags.append(self.bitflag_filter_item) - else: - flags.append(0) + flags.append(0 if item.is_internal else self.bitflag_filter_item) return flags, indices diff --cc release/scripts/startup/bl_ui/properties_paint_common.py index 2fd34c78722,3cd5df4df7d..ca7bbdf38c4 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@@ -2151,14 -954,17 +2151,17 @@@ def brush_settings_advanced(layout, con layout.separator() - col = layout.column(align=True) - row = col.row() - row.prop(brush, "use_automasking_cavity", text="Cavity") + #col = layout.column(align=True) + #row = col.row() + #row.prop(brush, "use_automasking_cavity", text="Cavity") - is_cavity_active = brush.use_automasking_cavity or brush.use_automasking_cavity_inverted + is_cavity_active = "CAVITY" in flags or "CAVITY_INVERTED" in flags if is_cavity_active: - layout.operator("sculpt.mask_from_cavity", text="Create Mask") + props = row.operator("sculpt.mask_from_cavity", text="Create Mask") + props.settings_source = "BRUSH" + + col.prop(brush, "use_automasking_cavity_inverted", text="Cavity (inverted)") if is_cavity_active: col = layout.column(align=True) diff --cc release/scripts/startup/bl_ui/space_view3d.py index a48441d6cff,63aff89aa7d..9ee1f2bb118 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@@ -18,8 -18,13 +18,12 @@@ from bl_ui.properties_grease_pencil_com from bl_ui.space_toolsystem_common import ( ToolActivePanelHelper, ) - from bpy.app.translations import contexts as i18n_contexts + from bpy.app.translations import ( + pgettext_iface as iface_, + pgettext_tip as tip_, + contexts as i18n_contexts, + ) - class VIEW3D_HT_tool_header(Header): bl_space_type = 'VIEW_3D' bl_region_type = 'TOOL_HEADER' diff --cc source/blender/blenkernel/BKE_bassrelief.h index e3dbc21df65,00000000000..81392f6c88c mode 100644,000000..100644 --- a/source/blender/blenkernel/BKE_bassrelief.h +++ b/source/blender/blenkernel/BKE_bassrelief.h @@@ -1,90 -1,0 +1,91 @@@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) Blender Foundation. + * All rights reserved. + */ +#pragma once + +/** \file + * \ingroup bke + */ + +#include "BKE_bvhutils.h" +#include "BLI_bitmap.h" +#include "BLI_math_matrix.h" + +struct Scene; +struct Mesh; +struct BassReliefModifierData; +struct Object; +struct MDeformVert; +struct ModifierEvalContext; +struct MPropCol; + +#define MAX_BASSRELIEF_DEBUG_COLORS 7 + +#ifdef __cplusplus +extern "C" { +#endif + +/* Information about a mesh and BVH tree. */ +typedef struct BassReliefTreeData { + Mesh *mesh; + const MPoly *mpoly; + + BVHTree *bvh; + BVHTreeFromMesh treeData; + struct SpaceTransform transform; + float keepDist; + ++ const float (*vert_normals)[3]; + float (*pnors)[3]; + float (*clnors)[3]; +} BassReliefTreeData; + +void bassReliefModifier_deform(struct BassReliefModifierData *smd, + const struct ModifierEvalContext *ctx, + struct Scene *scene, + struct Object *ob, + struct Mesh *mesh, + const struct MDeformVert *dvert, + const int defgrp_index, + float (*vertexCos)[3], + int numVerts, + struct MPropCol *debugColors[MAX_BASSRELIEF_DEBUG_COLORS]); + +/* + * NULL initializes to local data + */ +#define NULL_BassReliefCalcData \ + { \ + NULL, \ + } +#define NULL_BVHTreeFromMesh \ + { \ + NULL, \ + } +#define NULL_BVHTreeRayHit \ + { \ + NULL, \ + } +#define NULL_BVHTreeNearest \ + { \ + 0, \ + } + +#ifdef __cplusplus +} +#endif diff --cc source/blender/blenkernel/BKE_mesh.h index 24e2c7c384d,66974dbedb5..3482d3638c7 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@@ -74,10 -70,16 +74,17 @@@ void BKE_mesh_tag_coords_changed(struc */ void BKE_mesh_tag_coords_changed_uniformly(struct Mesh *mesh); + void BKE_mesh_tag_topology_changed(struct Mesh *mesh); + + /** + * Call when new edges and vertices have been created but positions and faces haven't changed. + */ + void BKE_mesh_tag_edges_split(struct Mesh *mesh); + /* *** mesh.c *** */ -struct BMesh *BKE_mesh_to_bmesh_ex(const struct Mesh *me, +struct BMesh *BKE_mesh_to_bmesh_ex(const struct Object *ob, + const struct Mesh *me, const struct BMeshCreateParams *create_params, const struct BMeshFromMeshParams *convert_params); struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, diff --cc source/blender/blenkernel/BKE_pbvh.h index 6e11cbff098,139b6ff6bbe..2efed15b921 --- a/source/blender/blenkernel/BKE_pbvh.h +++ b/source/blender/blenkernel/BKE_pbvh.h @@@ -16,93 -16,17 +16,94 @@@ /* For embedding CCGKey in iterator. */ #include "BKE_attribute.h" #include "BKE_ccg.h" ++ +#include <stdint.h> + +//#define DEFRAGMENT_MEMORY + #include "DNA_customdata_types.h" #ifdef __cplusplus extern "C" { #endif - // experimental feature to detect quad diagonals and mark (but not dissolve) them ++/* Experimental feature to detect quad diagonals and mark (but not dissolve) them. */ +//#define SCULPT_DIAGONAL_EDGE_MARKS + +/* + These structs represent logical verts/edges/faces. + for PBVH_GRIDS and PBVH_FACES they store integer + offsets, PBVH_BMESH stores pointers. + + The idea is to enforce stronger type checking by encapsulating + intptr_t's in structs.*/ +typedef struct PBVHVertRef { + intptr_t i; +} PBVHVertRef; + +typedef struct PBVHEdgeRef { + intptr_t i; +} PBVHEdgeRef; + +typedef struct PBVHFaceRef { + intptr_t i; +} PBVHFaceRef; + +#define PBVH_REF_NONE ((intptr_t)-1) + +typedef struct SculptPMap { + struct MeshElemMap *pmap; + int *pmap_mem; + int refcount; +} SculptPMap; + +#if 0 +typedef struct SculptLoopRef { + intptr_t i; +} SculptLoopRef; +#endif + +#ifdef DEFRAGMENT_MEMORY +# include "BLI_smallhash.h" +#endif + +typedef struct PBVHTri { + int v[3]; // references into PBVHTriBuf->verts + int eflag; // bitmask of which edges in the tri are real edges in the mesh + intptr_t l[3]; // loops + + float no[3]; + PBVHFaceRef f; +} PBVHTri; + +typedef struct PBVHTriBuf { + PBVHTri *tris; + PBVHVertRef *verts; + int *edges; + int totvert, totedge, tottri; + int verts_size, edges_size, tris_size; + + SmallHash vertmap; // maps vertex ptrs to indices within verts + + // private field + intptr_t *loops; + int totloop, mat_nr; + float min[3], max[3]; +} PBVHTriBuf; + +//#define WITH_PBVH_CACHE + struct BMLog; struct BMesh; +struct BMVert; +struct BMEdge; +struct BMFace; +struct Scene; struct CCGElem; +struct MeshElemMap; struct CCGKey; struct CustomData; +struct TableGSet; struct DMFlagMat; struct IsectRayPrecalc; struct MLoop; @@@ -217,9 -97,17 +218,18 @@@ typedef struct typedef struct { float (*color)[4]; + int size; } PBVHColorBufferNode; + typedef struct PBVHPixels { + /** + * Storage for texture painting on PBVH level. + * + * Contains #blender::bke::pbvh::pixels::PBVHData + */ + void *data; + } PBVHPixels; + typedef struct PBVHPixelsNode { /** * Contains triangle/pixel data used during texture painting. @@@ -668,7 -453,7 +680,8 @@@ void BKE_pbvh_update_all_tri_areas(PBV void BKE_pbvh_node_mark_update(PBVHNode *node); void BKE_pbvh_node_mark_update_mask(PBVHNode *node); void BKE_pbvh_node_mark_update_color(PBVHNode *node); +void BKE_pbvh_vert_tag_update_normal_visibility(PBVHNode *node); + void BKE_pbvh_node_mark_update_face_sets(PBVHNode *node); void BKE_pbvh_node_mark_update_visibility(PBVHNode *node); void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node); void BKE_pbvh_node_mark_redraw(PBVHNode *node); @@@ -916,18 -690,53 +934,66 @@@ void pbvh_vertex_iter_init(PBVH *pbvh, } \ ((void)0) +#define BKE_pbvh_vertex_to_index(pbvh, v) \ + (BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMVert *)( @@ Diff output truncated at 10240 characters. @@ _______________________________________________ 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