[Bf-blender-cvs] [6a638e95551] soc-2018-npr: Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr, also fix errors in modifier code.
Nick Wu
noreply at git.blender.org
Sat Oct 20 07:06:03 CEST 2018
Commit: 6a638e95551bdc4d0310b392b39b8a7d8eed6517
Author: Nick Wu
Date: Sat Oct 20 13:05:21 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB6a638e95551bdc4d0310b392b39b8a7d8eed6517
Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr, also fix errors in modifier code.
# Conflicts:
# release/scripts/startup/bl_ui/properties_data_camera.py
# release/scripts/startup/bl_ui/properties_data_speaker.py
# release/scripts/startup/bl_ui/properties_render.py
# release/scripts/startup/bl_ui/properties_scene.py
# source/blender/makesrna/intern/rna_scene.c
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/properties_data_camera.py
index 7c4a3770b41,0e3ee0e3044..9862013f08b
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@@ -181,7 -181,8 +181,8 @@@ class DATA_PT_camera_stereoscopy(Camera
class DATA_PT_camera(CameraButtonsPanel, Panel):
bl_label = "Camera"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', 'BLENDER_LANPR'}
+ bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
def draw_header_preset(self, context):
CAMERA_PT_presets.draw_panel_header(self.layout)
diff --cc release/scripts/startup/bl_ui/properties_scene.py
index 4962a5c7626,47f6c7662b1..3e914db5e5c
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@@ -74,7 -74,8 +74,8 @@@ class SCENE_PT_scene(SceneButtonsPanel
class SCENE_PT_unit(SceneButtonsPanel, Panel):
bl_label = "Units"
+ bl_options = {'DEFAULT_CLOSED'}
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL', "BLENDER_LANPR"}
def draw(self, context):
layout = self.layout
diff --cc source/blender/makesrna/intern/rna_scene.c
index 661c0620b07,7679ff41ba3..77dbdec5bdc
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@@ -459,27 -457,27 +459,27 @@@ static const EnumPropertyItem rna_enum_
#endif
const EnumPropertyItem rna_enum_transform_pivot_items_full[] = {
- {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
+ {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_PIVOT_BOUNDBOX, "Bounding Box Center",
- "Pivot around bounding box center of selected object(s)"},
+ "Pivot around bounding box center of selected object(s)"},
- {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
- {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
+ {V3D_AROUND_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
+ {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_PIVOT_INDIVIDUAL,
- "Individual Origins", "Pivot around each object's own origin"},
+ "Individual Origins", "Pivot around each object's own origin"},
- {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
+ {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_PIVOT_MEDIAN, "Median Point",
- "Pivot around the median point of selected objects"},
+ "Pivot around the median point of selected objects"},
- {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
+ {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_PIVOT_ACTIVE, "Active Element", "Pivot around active object"},
{0, NULL, 0, NULL, NULL}
};
/* Icons could be made a consistent set of images. */
const EnumPropertyItem rna_enum_transform_orientation_items[] = {
- {V3D_MANIP_GLOBAL, "GLOBAL", ICON_SCENE_DATA, "Global", "Align the transformation axes to world space"},
- {V3D_MANIP_LOCAL, "LOCAL", ICON_MANIPUL, "Local", "Align the transformation axes to the selected objects' local space"},
- {V3D_MANIP_NORMAL, "NORMAL", ICON_SNAP_NORMAL, "Normal",
+ {V3D_MANIP_GLOBAL, "GLOBAL", ICON_ORIENTATION_GLOBAL, "Global", "Align the transformation axes to world space"},
+ {V3D_MANIP_LOCAL, "LOCAL", ICON_ORIENTATION_LOCAL, "Local", "Align the transformation axes to the selected objects' local space"},
+ {V3D_MANIP_NORMAL, "NORMAL", ICON_ORIENTATION_NORMAL, "Normal",
- "Align the transformation axes to average normal of selected elements "
- "(bone Y axis for pose mode)"},
+ "Align the transformation axes to average normal of selected elements "
+ "(bone Y axis for pose mode)"},
- {V3D_MANIP_GIMBAL, "GIMBAL", ICON_NDOF_DOM, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
- {V3D_MANIP_VIEW, "VIEW", ICON_VISIBLE_IPO_ON, "View", "Align the transformation axes to the window"},
- {V3D_MANIP_CURSOR, "CURSOR", ICON_CURSOR, "Cursor", "Align the transformation axes to the 3D cursor"},
+ {V3D_MANIP_GIMBAL, "GIMBAL", ICON_ORIENTATION_GIMBAL, "Gimbal", "Align each axis to the Euler rotation axis as used for input"},
+ {V3D_MANIP_VIEW, "VIEW", ICON_ORIENTATION_VIEW, "View", "Align the transformation axes to the window"},
+ {V3D_MANIP_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, "Cursor", "Align the transformation axes to the 3D cursor"},
// {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"},
{0, NULL, 0, NULL, NULL}
};
diff --cc source/blender/modifiers/intern/MOD_mybmesh.c
index 8be71336340,00000000000..c22a0bc6451
mode 100644,000000..100644
--- a/source/blender/modifiers/intern/MOD_mybmesh.c
+++ b/source/blender/modifiers/intern/MOD_mybmesh.c
@@@ -1,4515 -1,0 +1,4515 @@@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * 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.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ *
+ */
+
+/** \file blender/modifiers/intern/MOD_mybmesh.c
+ * \ingroup modifiers
+ */
+
+/* This code is based of the tessellation part of the paper
+ * "Computing Smooth Surface Contours with Accurate Topology"
+ * (Pierre Bénard, Aaron Hertzmann, Michael Kass).
+ * Currently available at:
+ * http://www.labri.fr/perso/pbenard/publications/contours.html
+ *
+ * The numbers in the comments refers to the chapters in the paper.
+ */
+
+
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_math.h"
+#include "BLI_string.h"
+#include "BLI_utildefines.h"
+#include "BLI_buffer.h"
+#include "BLI_alloca.h"
+#include "BLI_ghash.h"
+#include "BLI_gsqueue.h"
+#include "BLI_memarena.h"
+#include "BLI_rand.h"
+#include "BLI_listbase.h"
+#include "BLI_threads.h"
+
+#include "BKE_library_query.h"
+#include "BKE_modifier.h"
+#include "BKE_mesh.h"
+#include "BKE_mesh_mapping.h"
+#include "BKE_deform.h"
+
+#include "bmesh.h"
+#include "bmesh_tools.h"
+
+#include "MOD_util.h"
+#include "MOD_modifiertypes.h"
+
+#include "DEG_depsgraph_build.h"
+
+//BMesh intern
+#include "../../bmesh/intern/bmesh_private.h"
+
+//TODO this modifier depends on OpenSubDiv. So if it's not compiled in, remove this modifier
+
+#include "../../../../intern/opensubdiv/opensubdiv_capi.h"
+#include "../../../../intern/opensubdiv/opensubdiv_converter_capi.h"
+#include "../../../../intern/opensubdiv/opensubdiv_evaluator_capi.h"
+#include "../../../../intern/opensubdiv/opensubdiv_topology_refiner_capi.h"
+
+#include "../../blenkernel/intern/subdiv_converter.h"
+
+#include "PIL_time.h"
+#include "PIL_time_utildefines.h"
+
+struct OpenSubdiv_Evaluator;
+
+typedef struct {
+ BMVert *vert; //Only used for shifted verts
+ BMEdge *orig_edge;
+ BMFace *orig_face;
+ float u, v;
+} Vert_buf;
+
+typedef struct {
+ BMEdge *cusp_e;
+ BMFace *orig_face;
+ float cusp_co[3];
+ float cusp_no[3];
+
+ float u, v;
+} Cusp;
+
+typedef struct {
+ bool b_arr[3];
+ bool kr_arr[3];
+ float co_arr[3][3];
+ float u_arr[3];
+ float v_arr[3];
+} Cusp_triang;
+
+typedef struct {
+ BMVert *vert;
+ BMVert *C_vert;
+ //Can we extend this radial vert?
+ bool extendable;
+ bool is_B;
+ float radi_plane_no[3];
+} Radi_vert;
+
+typedef struct {
+ BMFace *face;
+ //Should be front or back facing?
+ bool back_f;
+} IncoFace;
+
+typedef struct {
+ BMesh *bm;
+ BMesh *bm_orig;
+
+ float cam_loc[3];
+
+ GHash *vert_hash;
+
+ BLI_Buffer *new_vert_buffer;
+ BLI_Buffer *shifted_verts;
+ BLI_Buffer *cusp_edges;
+ BLI_Buffer *C_verts;
+ BLI_Buffer *cusp_verts;
+ BLI_Buffer *radi_vert_buffer;
+ //Radial edge vert start idx
+ int new_vert_idx;
+ int radi_start_idx;
+
+ struct OpenSubdiv_Evaluator *eval;
+} MeshData;
+
+//TODO for Kr look in subdiv.cpp in coutours source code (II)
+
+//TODO dynamic arrays, use BLI_stack, BLI_buffer, BLI_mempool, BLI_memarena.
+
+static void verts_to_limit(BMesh *bm, struct OpenSubdiv_Evaluator *eval){
+
+ int i, j;
+
+ BMIter iter_v, iter_f;
+ BMVert *vert;
+ BMFace *f;
+
+ //TODO is it possible to only get non adjusted verts?
+ //IE not moving a vert more than once.
+
+ BM_ITER_MESH_INDEX (f, &iter_f, bm, BM_FACES_OF_MESH, i) {
+ BM_ITER_ELEM_INDEX (vert, &iter_v, f, BM_VERTS_OF_FACE, j) {
+ float u,v, du[3], dv[3];
+ switch(j){
+ case 1 :
+ u = 1, v = 0;
+ break;
+ case 2 :
+ u = v = 1;
+ break;
+ case 3 :
+ u = 0, v = 1;
+ break;
+ default:
+ u = v = 0;
+ break;
+ }
+ eval->evaluateLimit(eval, i, u, v, vert->co, du, dv);
+ //Adjust vert normal to the limit normal
+ cross_v3_v3v3(vert->no, du, dv);
+ normalize_v3(vert->no);
+ //printf("j: %d\n",j);
+ }
+ //printf("i: %d\n",i);
+ //printf("face i: %d\n", BM_elem_index_get(f));
+ }
+
+}
+
+static Vert_buf* get_shift_vert( BMVert *vert, MeshData *m_d ){
+ int vert_i;
+
+ //check if vert is in the buffer
+ for(vert_i = 0; vert_i < m_d->shifted_verts->count; vert_i++){
+ Vert_buf *buf = &BLI_buffer_at(m_d->shifted_verts, Vert_buf, vert_i);
+ if( vert == buf->vert ){
+ return buf;
+ }
+ }
+ retu
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list