[Bf-blender-cvs] [3559b8a651f] temp-trimesh-sculpt: Merge branch 'master' into joeedh-trimesh-sculpt
Joseph Eagar
noreply at git.blender.org
Wed Oct 14 04:05:44 CEST 2020
Commit: 3559b8a651f8c714496f6e66d774b81fefcbab30
Author: Joseph Eagar
Date: Wed Sep 30 05:13:47 2020 -0700
Branches: temp-trimesh-sculpt
https://developer.blender.org/rB3559b8a651f8c714496f6e66d774b81fefcbab30
Merge branch 'master' into joeedh-trimesh-sculpt
===================================================================
===================================================================
diff --cc intern/cycles/kernel/kernel_types.h
index 10e7268ae9d,77e134da4b0..951dcbe0eb0
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@@ -1347,11 -1373,10 +1374,13 @@@ typedef struct KernelIntegrator
/* sampler */
int sampling_pattern;
+ int coherency_shift;
+ int coherency_only_blue;
+ int use_bluenoise_seeds;
int aa_samples;
int adaptive_min_samples;
+ int adaptive_step;
+ int adaptive_stop_per_sample;
float adaptive_threshold;
/* volume render */
@@@ -1363,6 -1388,8 +1392,7 @@@
int start_sample;
int max_closures;
-
- int pad1, pad2;
++ int pad1;
} KernelIntegrator;
static_assert_align(KernelIntegrator, 16);
diff --cc intern/ghost/intern/GHOST_WindowWin32.cpp
index 43020fbe489,55525157753..ec5062dc621
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@@ -1034,79 -1029,78 +1029,97 @@@ GHOST_TSuccess GHOST_WindowWin32::getPo
return GHOST_kFailure;
}
- pointerInfo->hasButtonMask = GHOST_kSuccess;
- switch (pointerApiInfo.ButtonChangeType) {
- case POINTER_CHANGE_FIRSTBUTTON_DOWN:
- case POINTER_CHANGE_FIRSTBUTTON_UP:
- pointerInfo->buttonMask = GHOST_kButtonMaskLeft;
- break;
- case POINTER_CHANGE_SECONDBUTTON_DOWN:
- case POINTER_CHANGE_SECONDBUTTON_UP:
- pointerInfo->buttonMask = GHOST_kButtonMaskRight;
- break;
- case POINTER_CHANGE_THIRDBUTTON_DOWN:
- case POINTER_CHANGE_THIRDBUTTON_UP:
- pointerInfo->buttonMask = GHOST_kButtonMaskMiddle;
- break;
- case POINTER_CHANGE_FOURTHBUTTON_DOWN:
- case POINTER_CHANGE_FOURTHBUTTON_UP:
- pointerInfo->buttonMask = GHOST_kButtonMaskButton4;
- break;
- case POINTER_CHANGE_FIFTHBUTTON_DOWN:
- case POINTER_CHANGE_FIFTHBUTTON_UP:
- pointerInfo->buttonMask = GHOST_kButtonMaskButton5;
- break;
- default:
- pointerInfo->hasButtonMask = GHOST_kFailure;
- break;
- }
-
- pointerInfo->pixelLocation = pointerApiInfo.ptPixelLocation;
- pointerInfo->tabletData.Active = GHOST_kTabletModeNone;
- pointerInfo->tabletData.Pressure = 1.0f;
- pointerInfo->tabletData.Xtilt = 0.0f;
- pointerInfo->tabletData.Ytilt = 0.0f;
-
- if (pointerApiInfo.pointerType == PT_PEN) {
- POINTER_PEN_INFO pointerPenInfo;
- if (m_fpGetPointerPenInfo && m_fpGetPointerPenInfo(pointerInfo->pointerId, &pointerPenInfo)) {
- pointerInfo->tabletData.Active = GHOST_kTabletModeStylus;
-
- if (pointerPenInfo.penMask & PEN_MASK_PRESSURE) {
- pointerInfo->tabletData.Pressure = pointerPenInfo.pressure / 1024.0f;
- }
+ GHOST_TInt32 pointerId = GET_POINTERID_WPARAM(wParam);
+ GHOST_TInt32 isPrimary = IS_POINTER_PRIMARY_WPARAM(wParam);
+ GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)GHOST_System::getSystem();
+ GHOST_TUns32 outCount;
- if (pointerPenInfo.penFlags & PEN_FLAG_ERASER) {
- pointerInfo->tabletData.Active = GHOST_kTabletModeEraser;
- }
+ if (!(m_fpGetPointerInfoHistory && m_fpGetPointerInfoHistory(pointerId, &outCount, NULL))) {
+ return GHOST_kFailure;
+ }
- if (pointerPenInfo.penFlags & PEN_MASK_TILT_X) {
- pointerInfo->tabletData.Xtilt = fmin(fabs(pointerPenInfo.tiltX / 90), 1.0f);
- }
+ auto pointerPenInfo = std::vector<POINTER_PEN_INFO>(outCount);
+ outPointerInfo.resize(outCount);
- if (pointerPenInfo.penFlags & PEN_MASK_TILT_Y) {
- pointerInfo->tabletData.Ytilt = fmin(fabs(pointerPenInfo.tiltY / 90), 1.0f);
- }
- }
- } else if (pointerApiInfo.pointerType == PT_TOUCH) {
++#if 0
++ if (pointerApiInfo.pointerType == PT_TOUCH) {
+ POINTER_TOUCH_INFO pointerTouchInfo;
+
+ if (m_fpGetPointerTouchInfo && m_fpGetPointerTouchInfo(pointerInfo->pointerId, &pointerTouchInfo)) {
+ pointerInfo->tabletData.Active = GHOST_kTabletModeStylus;
+
+ if (pointerTouchInfo.touchMask & TOUCH_MASK_PRESSURE) {
+ pointerInfo->tabletData.Pressure = ((float)pointerTouchInfo.pressure) / 1024.0f;
+ }
+
+ if (pointerTouchInfo.touchMask & TOUCH_MASK_ORIENTATION) {
+ pointerInfo->tabletData.Xtilt = fmin(fabs((float)pointerTouchInfo.orientation / 359.0f), 1.0f);
+ }
+ } else {
+ pointerInfo->tabletData.Active = GHOST_kTabletModeNone;
+ }
- } else {
- return GHOST_kFailure;
++ }
++#endif
++
+ if (!(m_fpGetPointerPenInfoHistory &&
+ m_fpGetPointerPenInfoHistory(pointerId, &outCount, pointerPenInfo.data()))) {
+ return GHOST_kFailure;
+ }
+
+ for (GHOST_TUns32 i = 0; i < outCount; i++) {
+ POINTER_INFO pointerApiInfo = pointerPenInfo[i].pointerInfo;
+ // Obtain the basic information from the event
+ outPointerInfo[i].pointerId = pointerId;
+ outPointerInfo[i].isPrimary = isPrimary;
+
+ switch (pointerApiInfo.ButtonChangeType) {
+ case POINTER_CHANGE_FIRSTBUTTON_DOWN:
+ case POINTER_CHANGE_FIRSTBUTTON_UP:
+ outPointerInfo[i].buttonMask = GHOST_kButtonMaskLeft;
+ break;
+ case POINTER_CHANGE_SECONDBUTTON_DOWN:
+ case POINTER_CHANGE_SECONDBUTTON_UP:
+ outPointerInfo[i].buttonMask = GHOST_kButtonMaskRight;
+ break;
+ case POINTER_CHANGE_THIRDBUTTON_DOWN:
+ case POINTER_CHANGE_THIRDBUTTON_UP:
+ outPointerInfo[i].buttonMask = GHOST_kButtonMaskMiddle;
+ break;
+ case POINTER_CHANGE_FOURTHBUTTON_DOWN:
+ case POINTER_CHANGE_FOURTHBUTTON_UP:
+ outPointerInfo[i].buttonMask = GHOST_kButtonMaskButton4;
+ break;
+ case POINTER_CHANGE_FIFTHBUTTON_DOWN:
+ case POINTER_CHANGE_FIFTHBUTTON_UP:
+ outPointerInfo[i].buttonMask = GHOST_kButtonMaskButton5;
+ break;
+ default:
+ break;
+ }
+
+ outPointerInfo[i].pixelLocation = pointerApiInfo.ptPixelLocation;
+ outPointerInfo[i].tabletData.Active = GHOST_kTabletModeStylus;
+ outPointerInfo[i].tabletData.Pressure = 1.0f;
+ outPointerInfo[i].tabletData.Xtilt = 0.0f;
+ outPointerInfo[i].tabletData.Ytilt = 0.0f;
+ outPointerInfo[i].time = system->performanceCounterToMillis(pointerApiInfo.PerformanceCount);
+
+ if (pointerPenInfo[i].penMask & PEN_MASK_PRESSURE) {
+ outPointerInfo[i].tabletData.Pressure = pointerPenInfo[i].pressure / 1024.0f;
+ }
+
+ if (pointerPenInfo[i].penFlags & PEN_FLAG_ERASER) {
+ outPointerInfo[i].tabletData.Active = GHOST_kTabletModeEraser;
+ }
+
+ if (pointerPenInfo[i].penMask & PEN_MASK_TILT_X) {
+ outPointerInfo[i].tabletData.Xtilt = fmin(fabs(pointerPenInfo[i].tiltX / 90.0f), 1.0f);
+ }
+
+ if (pointerPenInfo[i].penMask & PEN_MASK_TILT_Y) {
+ outPointerInfo[i].tabletData.Ytilt = fmin(fabs(pointerPenInfo[i].tiltY / 90.0f), 1.0f);
+ }
}
-
return GHOST_kSuccess;
}
diff --cc source/blender/blenkernel/BKE_paint.h
index 27363484673,653c8a752d5..7bfcb9942cd
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -296,11 -440,12 +440,15 @@@ typedef struct SculptSession
int *pmap_mem;
/* Mesh Face Sets */
+ /* Total number of polys of the base mesh. */
+ int totfaces;
+ /* Face sets store its visibility in the sign of the integer, using the absolute value as the
+ * Face Set ID. Positive IDs are visible, negative IDs are hidden. */
int *face_sets;
+ struct TM_TriMesh *tm;
+ struct TriMeshLog *tm_log;
+
/* BMesh for dynamic topology sculpting */
struct BMesh *bm;
int cd_vert_node_offset;
@@@ -402,9 -559,10 +561,14 @@@ void BKE_sculptsession_free_vwpaint_dat
void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
void BKE_sculptsession_bm_to_me_for_render(struct Object *object);
+void BKE_sculptsession_tm_to_me(struct Object *ob, bool reorder);
+void BKE_sculptsession_tm_to_me_for_render(struct Object *object);
+
++
+ /* Create new color layer on object if it doesn't have one and if experimental feature set has
+ * sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise. */
+ void BKE_sculpt_color_layer_create_if_needed(struct Object *object);
+
void BKE_sculpt_update_object_for_edit(struct Depsgraph *depsgraph,
struct Object *ob_orig,
bool need_pmap,
diff --cc source/blender/blenkernel/BKE_pbvh.h
index 8d26704446d,cd213b49c5b..fb56c13d0c8
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@@ -118,15 -126,7 +126,16 @@@ void BKE_pbvh_build_bmesh(PBVH *pbvh
struct BMLog *log,
const int cd_vert_node_offset,
const int cd_face_node_offset);
+void BKE_pbvh_build_trimesh(PBVH *bvh,
+ struct TM_TriMesh *bm,
+ bool smooth_shading,
+ struct TriMeshLog *log,
+ const int cd_vert_node_offset,
+ const int cd_face_node_offset);
+
+void BKE_pbvh_free(PBVH *bvh);
- void BKE_pbvh_free_layer_disp(PBVH *bvh);
++//void BKE_pbvh_free_layer_disp(PBVH *bvh);
+ void BKE_pbvh_free(PBVH *pbvh);
/* Hierarchical Search in the BVH, two methods:
* - for each hit calling a callback
@@@ -215,20 -211,19 +225,20 @@@ typedef enum
PBVH_FACES,
PBVH_GRIDS,
PBVH_BMESH,
+ PBVH_TRIMESH
} PBVHType;
- PBVHType BKE_pbvh_type(const PBVH *bvh);
- bool BKE_pbvh_has_faces(const PBVH *bvh);
+ PBVHType BKE_pbvh_type(const PBVH *pbvh);
+ bool BKE_pbvh_has_faces(const PBVH *pbvh);
/* Get the PBVH root's bounding box */
- void BKE_pbvh_bounding_box(const PBVH *bvh, float min[3], float max[3]);
+ void BKE_pbvh_bounding_box(const PBVH *pbvh, float min[3], float max[3]);
/* multires hidden data, only valid for type == PBVH_GRIDS */
- unsigned int **BKE_pbvh_grid_hidden(const PBVH *bvh);
+ unsigned int **BKE_pbvh_grid_hidden(const PBVH *pbvh);
int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden,
- int *grid_indices,
+ const int *grid_indices
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list