[Bf-blender-cvs] [1bda27f] master: Tooltip improvements for modifier functions
Commit: 1bda27f6928a4bb1e48a6eaffadbf242977a6c83 Author: gaiaclary Date: Mon Jul 14 11:50:01 2014 +0200 https://developer.blender.org/rB1bda27f6928a4bb1e48a6eaffadbf242977a6c83 Tooltip improvements for modifier functions === M source/blender/editors/interface/interface_templates.c M source/blender/makesrna/intern/rna_modifier.c === diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index ffefc12..1c5d3ec 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -890,7 +890,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, /* -- convert to rna ? */ but = uiDefIconButBitI(block, TOG, eModifierMode_OnCage, 0, ICON_MESH_DATA, 0, 0, UI_UNIT_X - 2, UI_UNIT_Y, md-mode, 0.0, 0.0, 0.0, 0.0, - TIP_(Interactive edit)); + TIP_(Adjust edit cage to modifier result)); if (index cageIndex) uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFunc(but, modifiers_setOnCage, ob, md); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 116a617..a998da6 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -3681,20 +3681,20 @@ void RNA_def_modifier(BlenderRNA *brna) /* flags */ prop = RNA_def_property(srna, show_viewport, PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, mode, eModifierMode_Realtime); - RNA_def_property_ui_text(prop, Realtime, Display modifier in realtime); + RNA_def_property_ui_text(prop, Realtime, Display modifier in viewport); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_update(prop, 0, rna_Modifier_update); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0); prop = RNA_def_property(srna, show_render, PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, mode, eModifierMode_Render); - RNA_def_property_ui_text(prop, Render, Use modifier during rendering); + RNA_def_property_ui_text(prop, Render, Use modifier during render); RNA_def_property_ui_icon(prop, ICON_SCENE, 0); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); prop = RNA_def_property(srna, show_in_editmode, PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, mode, eModifierMode_Editmode); - RNA_def_property_ui_text(prop, Edit Mode, Use modifier in Edit mode); + RNA_def_property_ui_text(prop, Edit Mode, Display modifier in Edit mode); RNA_def_property_update(prop, 0, rna_Modifier_update); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a70e439] soc-2014-fluid: removed pp files, preproessing during compiling step
Commit: a70e4394acce14e6190b93e85f09a51b04525a9e Author: Roman Pogribnyi Date: Mon Jul 14 12:57:43 2014 +0200 https://developer.blender.org/rBa70e4394acce14e6190b93e85f09a51b04525a9e removed pp files, preproessing during compiling step === M CMakeLists.txt M intern/smoke/intern/MANTA.h M source/blender/python/intern/bpy_interface.c M source/blender/python/manta_pp/CMakeLists.txt A source/blender/python/manta_pp/COPYING A source/blender/python/manta_pp/Doxyfile.in A source/blender/python/manta_pp/INSTALLING D source/blender/python/manta_pp/SConscript D source/blender/python/manta_pp/commonkernels.h D source/blender/python/manta_pp/commonkernels.h.reg D source/blender/python/manta_pp/commonkernels.h.reg.cpp D source/blender/python/manta_pp/conjugategrad.cpp D source/blender/python/manta_pp/conjugategrad.h D source/blender/python/manta_pp/conjugategrad.h.reg D source/blender/python/manta_pp/conjugategrad.h.reg.cpp D source/blender/python/manta_pp/cuda/buoyancy.cu D source/blender/python/manta_pp/cuda/cudatools.h D source/blender/python/manta_pp/cuda/curlnoise.cu D source/blender/python/manta_pp/cuda/curlnoise.h D source/blender/python/manta_pp/cuda/meshtools.cu D source/blender/python/manta_pp/cuda/particle.cu D source/blender/python/manta_pp/cuda/turbulence.cu A source/blender/python/manta_pp/dependencies/zlib-1.2.8/adler32.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/compress.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/crc32.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/crc32.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/deflate.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/deflate.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/gzclose.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/gzguts.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/gzlib.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/gzread.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/gzwrite.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/infback.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inffast.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inffast.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inffixed.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inflate.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inflate.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inftrees.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/inftrees.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/trees.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/trees.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/uncompr.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/zconf.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/zlib.h A source/blender/python/manta_pp/dependencies/zlib-1.2.8/zutil.c A source/blender/python/manta_pp/dependencies/zlib-1.2.8/zutil.h D source/blender/python/manta_pp/edgecollapse.cpp D source/blender/python/manta_pp/edgecollapse.h D source/blender/python/manta_pp/edgecollapse.h.reg D source/blender/python/manta_pp/edgecollapse.h.reg.cpp D source/blender/python/manta_pp/fastmarch.cpp D source/blender/python/manta_pp/fastmarch.h D source/blender/python/manta_pp/fastmarch.h.reg D source/blender/python/manta_pp/fastmarch.h.reg.cpp D source/blender/python/manta_pp/fileio.cpp D source/blender/python/manta_pp/fileio.h D source/blender/python/manta_pp/fileio.h.reg D source/blender/python/manta_pp/fileio.h.reg.cpp D source/blender/python/manta_pp/flip.cpp D source/blender/python/manta_pp/flip.h D source/blender/python/manta_pp/flip.h.reg D source/blender/python/manta_pp/flip.h.reg.cpp D source/blender/python/manta_pp/fluidsolver.cpp D source/blender/python/manta_pp/fluidsolver.h D source/blender/python/manta_pp/fluidsolver.h.reg D source/blender/python/manta_pp/general.cpp D source/blender/python/manta_pp/general.h.reg D source/blender/python/manta_pp/general.h.reg.cpp D source/blender/python/manta_pp/grid.cpp D source/blender/python/manta_pp/grid.h D source/blender/python/manta_pp/grid.h.reg D source/blender/python/manta_pp/grid.h.reg.cpp D source/blender/python/manta_pp/gui/customctrl.cpp D source/blender/python/manta_pp/gui/customctrl.h D source/blender/python/manta_pp/gui/customctrl.h.reg D source/blender/python/manta_pp/gui/customctrl.h.reg.cpp D
[Bf-blender-cvs] [25ef55b] soc-2014-fluid: library creation for Win systems
Commit: 25ef55b304afe76347594ed6213b2076fbc63745 Author: Roman Pogribnyi Date: Mon Jul 14 13:00:42 2014 +0200 https://developer.blender.org/rB25ef55b304afe76347594ed6213b2076fbc63745 library creation for Win systems === M source/blender/python/manta_pp/CMakeLists.txt === diff --git a/source/blender/python/manta_pp/CMakeLists.txt b/source/blender/python/manta_pp/CMakeLists.txt index 7963ace..4d6e53d 100755 --- a/source/blender/python/manta_pp/CMakeLists.txt +++ b/source/blender/python/manta_pp/CMakeLists.txt @@ -555,7 +555,8 @@ else() if (WIN32) # make nice folders for Visual Studio set_source_files_properties(${PP_SOURCES} ${PP_HEADERS} ${NOPP_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE) - add_executable(${EXECCMD} ${SOURCES} ${PP_REGISTRY} ${PP_SOURCES} ${PP_HEADERS}) +# add_executable(${EXECCMD} ${SOURCES} ${PP_REGISTRY} ${PP_SOURCES} ${PP_HEADERS}) + blender_add_lib(${EXECCMD} ${SOURCES} ${INCLUDE_PATHS} ${INC_SYS}) source_group(Generated FILES ${SOURCES} ${PP_REGISTRY} ${HEADERS}) else() # add_executable(${EXECCMD} ${SOURCES} ${PP_REGISTRY} ${HGINFO}) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a8e338c] master: Py/API: add bmesh.utils.face_split_edgenet
Commit: a8e338cee593c6a0b4130356d0fb4a2a993d8e83 Author: Campbell Barton Date: Mon Jul 14 21:31:06 2014 +1000 https://developer.blender.org/rBa8e338cee593c6a0b4130356d0fb4a2a993d8e83 Py/API: add bmesh.utils.face_split_edgenet === M source/blender/python/bmesh/bmesh_py_utils.c === diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index 4f1ca56..cc76012 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -477,6 +477,80 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args, } +PyDoc_STRVAR(bpy_bm_utils_face_split_edgenet_doc, +.. method:: face_split_edgenet(face, edgenet)\n +\n + Splits a face into any number of regions defined by an edgenet.\n +\n + :arg face: The face to split.\n + :type face: :class:`bmesh.types.BMFace`\n + :arg face: The face to split.\n + :type face: :class:`bmesh.types.BMFace`\n + :arg edgenet: Sequence of faces.\n + :type edgenet: :class:`bmesh.types.BMFace`\n + :return: The newly created faces.\n + :rtype: tuple of (:class:`bmesh.types.BMFace`)\n +); +static PyObject *bpy_bm_utils_face_split_edgenet(PyObject *UNUSED(self), PyObject *args, PyObject *kw) +{ + static const char *kwlist[] = {face, edgenet, NULL}; + + BPy_BMFace *py_face; + PyObject *edge_seq; + + BMEdge **edge_array; + Py_ssize_t edge_array_len; + + BMesh *bm; + + BMFace **face_arr; + int face_arr_len; + bool ok; + + + if (!PyArg_ParseTupleAndKeywords(args, kw, O!O:face_split_edgenet, (char **)kwlist, +BPy_BMFace_Type, py_face, +edge_seq)) + { + return NULL; + } + + BPY_BM_CHECK_OBJ(py_face); + + bm = py_face-bm; + + edge_array = BPy_BMElem_PySeq_As_Array(bm, edge_seq, 1, PY_SSIZE_T_MAX, + edge_array_len, BM_EDGE, + true, true, face_split_edgenet(...)); + + if (edge_array == NULL) { + return NULL; + } + + /* --- main function body --- */ + + ok = BM_face_split_edgenet(bm, py_face-f, edge_array, edge_array_len, + face_arr, face_arr_len); + + PyMem_FREE(edge_array); + + if (ok) { + PyObject *ret = PyTuple_New(face_arr_len); + int i; + for (i = 0; i face_arr_len; i++) { + PyTuple_SET_ITEM(ret, i, BPy_BMFace_CreatePyObject(bm, face_arr[i])); + } + MEM_freeN(face_arr); + return ret; + } + else { + PyErr_SetString(PyExc_ValueError, + face_split_edgenet(...): couldn't split the face, internal error); + return NULL; + } +} + + PyDoc_STRVAR(bpy_bm_utils_face_join_doc, .. method:: face_join(faces, remove=True)\n \n @@ -652,6 +726,7 @@ static struct PyMethodDef BPy_BM_utils_methods[] = { {edge_split, (PyCFunction)bpy_bm_utils_edge_split, METH_VARARGS, bpy_bm_utils_edge_split_doc}, {edge_rotate, (PyCFunction)bpy_bm_utils_edge_rotate, METH_VARARGS, bpy_bm_utils_edge_rotate_doc}, {face_split, (PyCFunction)bpy_bm_utils_face_split, METH_VARARGS | METH_KEYWORDS, bpy_bm_utils_face_split_doc}, + {face_split_edgenet, (PyCFunction)bpy_bm_utils_face_split_edgenet, METH_VARARGS | METH_KEYWORDS, bpy_bm_utils_face_split_edgenet_doc}, {face_join, (PyCFunction)bpy_bm_utils_face_join, METH_VARARGS, bpy_bm_utils_face_join_doc}, {face_vert_separate, (PyCFunction)bpy_bm_utils_face_vert_separate, METH_VARARGS, bpy_bm_utils_face_vert_separate_doc}, {face_flip, (PyCFunction)bpy_bm_utils_face_flip, METH_O, bpy_bm_utils_face_flip_doc}, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8a04bed] master: Error in last commit
Commit: 8a04bed7240d5bca7de4eb1dcbb8415692ece8c1 Author: Campbell Barton Date: Mon Jul 14 21:34:51 2014 +1000 https://developer.blender.org/rB8a04bed7240d5bca7de4eb1dcbb8415692ece8c1 Error in last commit === M source/blender/python/bmesh/bmesh_py_utils.c === diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index cc76012..cd5290b 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -486,8 +486,8 @@ PyDoc_STRVAR(bpy_bm_utils_face_split_edgenet_doc, :type face: :class:`bmesh.types.BMFace`\n :arg face: The face to split.\n :type face: :class:`bmesh.types.BMFace`\n - :arg edgenet: Sequence of faces.\n - :type edgenet: :class:`bmesh.types.BMFace`\n + :arg edgenet: Sequence of edges.\n + :type edgenet: :class:`bmesh.types.BMEdge`\n :return: The newly created faces.\n :rtype: tuple of (:class:`bmesh.types.BMFace`)\n ); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [aaa0383] soc-2013-paint: Paint Curves:
Commit: aaa0383ef3b509d09df8aa5f5f6843fbf0f0aa93 Author: Antony Riakiotakis Date: Mon Jul 14 15:00:34 2014 +0300 https://developer.blender.org/rBaaa0383ef3b509d09df8aa5f5f6843fbf0f0aa93 Paint Curves: * Change behaviour of selection - selecting in empty space now will not clear selection. This leads to: * Improved behaviour of right click translate. Now even dragging in empty space will drag correctly. === M source/blender/editors/sculpt_paint/paint_curve.c M source/blender/editors/sculpt_paint/paint_image_2d.c M source/blender/editors/sculpt_paint/paint_intern.h M source/blender/editors/sculpt_paint/paint_ops.c === diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c index 99d7463..2b7dee1 100644 --- a/source/blender/editors/sculpt_paint/paint_curve.c +++ b/source/blender/editors/sculpt_paint/paint_curve.c @@ -363,7 +363,7 @@ void PAINTCURVE_OT_delete_point(wmOperatorType *ot) } -static void paintcurve_point_select(bContext *C, wmOperator *op, const int loc[2], +static bool paintcurve_point_select(bContext *C, wmOperator *op, const int loc[2], bool handle, bool toggle, bool extend) { wmWindow *window = CTX_wm_window(C); @@ -373,20 +373,21 @@ static void paintcurve_point_select(bContext *C, wmOperator *op, const int loc[2 PaintCurve *pc; PaintCurvePoint *pcp; int i; - char select = 0; const float loc_fl[2] = {UNPACK2(loc)}; pc = br-paint_curve; if (!pc) - return; + return false; paintcurve_undo_begin(C, op, pc); pcp = pc-points; if (toggle) { + char select = 0; bool selected = false; + for (i = 0; i pc-tot_points; i++) { if (pcp[i].bez.f1 || pcp[i].bez.f2 || pcp[i].bez.f3) { selected = true; @@ -397,45 +398,95 @@ static void paintcurve_point_select(bContext *C, wmOperator *op, const int loc[2 if (!selected) { select = SELECT; } - } - if (!extend) { - /* first clear selection from all bezier handles */ for (i = 0; i pc-tot_points; i++) { - pcp[i].bez.f1 = pcp[i].bez.f2 = pcp[i].bez.f3 = select; + pc-points[i].bez.f1 = pc-points[i].bez.f2 = pc-points[i].bez.f3 = select; } } + else { +#define SEL_F1 (1 0) +#define SEL_F2 (1 1) +#define SEL_F3 (1 2) + int selflag; + bool selected = false; - if (!toggle) { for (i = 0; i pc-tot_points; i++, pcp++) { /* shift means constrained editing so exclude center handles from collision detection */ if (!handle) { if (len_manhattan_v2v2(loc_fl, pcp-bez.vec[1]) PAINT_CURVE_SELECT_THRESHOLD) { - pcp-bez.f2 ^= SELECT; + if (extend) + pcp-bez.f2 ^= SELECT; + else + pcp-bez.f2 = SELECT; pc-add_index = i + 1; + selflag = SEL_F2; break; } } if (len_manhattan_v2v2(loc_fl, pcp-bez.vec[0]) PAINT_CURVE_SELECT_THRESHOLD) { - pcp-bez.f1 ^= SELECT; + if (extend) + pcp-bez.f1 ^= SELECT; + else + pcp-bez.f1 = SELECT; pc-add_index = i + 1; + selflag = SEL_F1; if (handle) pcp-bez.h1 = HD_ALIGN; break; } if (len_manhattan_v2v2(loc_fl, pcp-bez.vec[2]) PAINT_CURVE_SELECT_THRESHOLD) { - pcp-bez.f3 ^= SELECT; + if (extend) + pcp-bez.f3 ^= SELECT; + else + pcp-bez.f3 = SELECT; pc-add_index = i + 1; + selflag = SEL_F3; if (handle) pcp-bez.h2 = HD_ALIGN; break; }
[Bf-blender-cvs] [55cf770] particles_refactor: Merge branch 'master' into particles_refactor
Commit: 55cf7703fd71f79e3f9ae9e523e27ce33396f276 Author: Lukas Tönne Date: Mon Jul 14 14:23:50 2014 +0200 https://developer.blender.org/rB55cf7703fd71f79e3f9ae9e523e27ce33396f276 Merge branch 'master' into particles_refactor Conflicts: source/blender/blenkernel/intern/object.c source/blender/blenkernel/intern/rigidbody.c source/blender/blenloader/intern/writefile.c source/blender/python/intern/bpy_interface.c source/creator/CMakeLists.txt === === diff --cc source/blender/blenkernel/BKE_rigidbody.h index 46a835c,c946f3a..05a6e48 --- a/source/blender/blenkernel/BKE_rigidbody.h +++ b/source/blender/blenkernel/BKE_rigidbody.h @@@ -60,11 -67,11 +60,14 @@@ struct RigidBodyWorld *BKE_rigidbody_wo void BKE_rigidbody_world_groups_relink(struct RigidBodyWorld *rbw); /* 'validate' (i.e. make new or replace old) Physics-Engine objects */ +struct rbRigidBody *BKE_rigidbody_body_ensure_alloc(struct RigidBodyWorld *rbw, struct rbRigidBody *body, bool rebuild); +void BKE_rigidbody_body_tag_used(struct rbRigidBody *body); +void BKE_rigidbody_validate_sim_shape(Object *ob, bool rebuild); void BKE_rigidbody_validate_sim_world(struct Scene *scene, struct RigidBodyWorld *rbw, bool rebuild); + void BKE_rigidbody_calc_volume(struct Object *ob, float *r_vol); + void BKE_rigidbody_calc_center_of_mass(struct Object *ob, float r_com[3]); + /* -- */ /* Utilities */ diff --cc source/blender/blenkernel/intern/object.c index 7585691,3490bb9..290a9e0 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@@ -98,8 -95,6 +95,7 @@@ #include BKE_editmesh.h #include BKE_mball.h #include BKE_modifier.h - #include BKE_node.h +#include BKE_nparticle.h #include BKE_object.h #include BKE_paint.h #include BKE_particle.h diff --cc source/blender/blenkernel/intern/rigidbody.c index d159f49,2aaf8ad..2046fbd --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@@ -47,11 -46,8 +47,9 @@@ # include RBI_api.h #endif - #include DNA_anim_types.h #include DNA_group_types.h - #include DNA_mesh_types.h #include DNA_meshdata_types.h +#include DNA_nparticle_types.h #include DNA_object_types.h #include DNA_object_force.h #include DNA_rigidbody_types.h @@@ -60,11 -56,8 +58,9 @@@ #include BKE_cdderivedmesh.h #include BKE_effect.h #include BKE_global.h - #include BKE_group.h #include BKE_library.h #include BKE_mesh.h +#include BKE_nparticle.h #include BKE_object.h #include BKE_pointcache.h #include BKE_rigidbody.h @@@ -425,124 -456,417 +420,300 @@@ void BKE_rigidbody_validate_sim_shape(O /* - */ + /* helper function to calculate volume of rigidbody object */ + // TODO: allow a parameter to specify method used to calculate this? + void BKE_rigidbody_calc_volume(Object *ob, float *r_vol) + { + RigidBodyOb *rbo = ob-rigidbody_object; + + float size[3] = {1.0f, 1.0f, 1.0f}; + float radius = 1.0f; + float height = 1.0f; + + float volume = 0.0f; + + /* if automatically determining dimensions, use the Object's boundbox +* - assume that all quadrics are standing upright on local z-axis +* - assume even distribution of mass around the Object's pivot +*(i.e. Object pivot is centralised in boundbox) +* - boundbox gives full width +*/ + // XXX: all dimensions are auto-determined now... later can add stored settings for this + BKE_object_dimensions_get(ob, size); + + if (ELEM3(rbo-shape, RB_SHAPE_CAPSULE, RB_SHAPE_CYLINDER, RB_SHAPE_CONE)) { + /* take radius as largest x/y dimension, and height as z-dimension */ + radius = MAX2(size[0], size[1]) * 0.5f; + height = size[2]; + } + else if (rbo-shape == RB_SHAPE_SPHERE) { + /* take radius to the the largest dimension to try and encompass everything */ + radius = max_fff(size[0], size[1], size[2]) * 0.5f; + } + + /* calculate volume as appropriate */ + switch (rbo-shape) { + case RB_SHAPE_BOX: + volume = size[0] * size[1] * size[2]; + break; + + case RB_SHAPE_SPHERE: + volume = 4.0f / 3.0f * (float)M_PI * radius * radius * radius; + break; + + /* for now, assume that capsule is close enough to a cylinder... */ + case RB_SHAPE_CAPSULE: + case RB_SHAPE_CYLINDER: + volume = (float)M_PI * radius * radius * height; + break; + + case RB_SHAPE_CONE: + volume = (float)M_PI / 3.0f * radius * radius *
[Bf-blender-cvs] [69f990a] particles_refactor: Disabled data access in particle RNA.
Commit: 69f990ad7ef35d102ccf138e9045b1944f75a2eb Author: Lukas Tönne Date: Mon Jul 14 15:00:55 2014 +0200 https://developer.blender.org/rB69f990ad7ef35d102ccf138e9045b1944f75a2eb Disabled data access in particle RNA. Only the general attribute descriptions and state instance can be accessed from plain bpy now. For detailed data read/write the bparticles module has to be used. This was forced by a change to collection iterators, which essentially makes them unsuitable for anything other than ListBase and arrays (state attributes and particle data in this case). It may be possible to reeanble this later, but generally bparticles is the better approach. === M source/blender/makesrna/intern/rna_nparticle.c === diff --git a/source/blender/makesrna/intern/rna_nparticle.c b/source/blender/makesrna/intern/rna_nparticle.c index 18ade0f..4b98d3e 100644 --- a/source/blender/makesrna/intern/rna_nparticle.c +++ b/source/blender/makesrna/intern/rna_nparticle.c @@ -52,6 +52,7 @@ static EnumPropertyItem nparticle_display_type_items[] = { #include RNA_access.h +#if 0 static StructRNA *rna_NParticleAttributeState_refine(PointerRNA *ptr) { NParticleAttributeState *attrstate = ptr-data; @@ -262,6 +263,7 @@ int rna_NParticleState_attributes_lookup_string(PointerRNA *ptr, const char *key RNA_pointer_create(ptr-id.data, RNA_NParticleAttributeState, attrstate, r_ptr); return attrstate != NULL; } +#endif #if 0 @@ -459,6 +461,7 @@ static void def_nparticle_attribute_description(StructRNA *srna, int update_flag RNA_def_property_clear_flag(prop, PROP_EDITABLE); } +#if 0 /* defines a subtype of NParticleAttribute with a specific collection property for actual data */ static void def_nparticle_attribute_state_type(BlenderRNA *brna, const char *state_structname, const char *data_structname, @@ -608,6 +611,7 @@ static void rna_def_nparticle_attribute_state(BlenderRNA *brna) #undef DEF_ATTR_TYPE_RNA } +#endif static void rna_def_nparticle_iterator(BlenderRNA *brna) { @@ -626,6 +630,7 @@ static void rna_def_nparticle_state(BlenderRNA *brna) srna = RNA_def_struct(brna, NParticleState, NULL); RNA_def_struct_ui_text(srna, Particle State, Data in a particle system for a specific frame); +#if 0 prop = RNA_def_property(srna, attributes, PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, rna_NParticleState_attributes_begin, rna_NParticleState_attributes_next, rna_NParticleState_attributes_end, rna_NParticleState_attributes_get, @@ -633,6 +638,7 @@ static void rna_def_nparticle_state(BlenderRNA *brna) rna_NParticleState_attributes_lookup_string, NULL); RNA_def_property_ui_text(prop, Attributes, Data layers associated to particles); RNA_def_property_struct_type(prop, NParticleAttributeState); +#endif #if 0 prop = RNA_def_property(srna, particles, PROP_COLLECTION, PROP_NONE); @@ -824,7 +830,9 @@ static void rna_def_nparticle_system(BlenderRNA *brna) void RNA_def_nparticle(BlenderRNA *brna) { +#if 0 rna_def_nparticle_attribute_state(brna); +#endif rna_def_nparticle_iterator(brna); rna_def_nparticle_state(brna); rna_def_nparticle_attribute(brna); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [911fe9d] particles_refactor: Fixed a few small merge errors. Sorted libs are now defined in macros.cmake.
Commit: 911fe9dfa27735d18a52c2e1f6c6225d2d944047 Author: Lukas Tönne Date: Mon Jul 14 14:59:17 2014 +0200 https://developer.blender.org/rB911fe9dfa27735d18a52c2e1f6c6225d2d944047 Fixed a few small merge errors. Sorted libs are now defined in macros.cmake. === M build_files/cmake/macros.cmake M source/blender/blenkernel/intern/rigidbody.c === diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index bfd1cf6..ed0e052 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -487,6 +487,7 @@ macro(SETUP_BLENDER_SORTED_LIBS) bf_python_ext bf_python_mathutils bf_python_bmesh + bf_python_bparticles bf_freestyle bf_ikplugin bf_modifiers diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 2046fbd..77636a8 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -887,7 +887,6 @@ static void rigidbody_world_build_particle_systems(Scene *UNUSED(scene), RigidBo } } -/* Construct Bullet bodies, shapes and constraints from a Blender scene. /** * Updates and validates world, bodies and shapes. * @@ -911,6 +910,7 @@ static void rigidbody_world_build(Scene *scene, RigidBodyWorld *rbw, int rebuild * Memory management needs redesign here, this is just a dirty workaround. */ if (rebuild rbw-constraints) { + GroupObject *go; for (go = rbw-constraints-gobject.first; go; go = go-next) { Object *ob = go-ob; if (ob) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61374] trunk/lib/windows/ opencolorio/readme.txt: Libs: OCIO readme tweak, again, new server mailing test, sorry
Revision: 61374 https://developer.blender.org/rBL61374 Author: sergey Date: 2014-07-14 13:50:14 + (Mon, 14 Jul 2014) Log Message: --- Libs: OCIO readme tweak, again, new server mailing test, sorry Modified Paths: -- trunk/lib/windows/opencolorio/readme.txt Modified: trunk/lib/windows/opencolorio/readme.txt === --- trunk/lib/windows/opencolorio/readme.txt2014-07-14 13:46:41 UTC (rev 61373) +++ trunk/lib/windows/opencolorio/readme.txt2014-07-14 13:50:14 UTC (rev 61374) @@ -6,9 +6,9 @@ * cmake configuration: cmake -G Visual Studio 9 2008 ^ - -D OCIO_USE_BOOST_PTR=ON ^ - -D BOOST_ROOT=C:\b\lib\windows\boost ^ - .. + -D OCIO_USE_BOOST_PTR=ON ^ + -D BOOST_ROOT=C:\b\lib\windows\boost ^ + .. * Build OpenColorIO from the IDE * Copy needed files to Blender's library folder ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8554fa2] master: GHash, EdgeHash: add debugging function to measure the hash quality
Commit: 8554fa2fad63c20ff0c23894ad0b41087d149a32 Author: Campbell Barton Date: Mon Jul 14 23:59:47 2014 +1000 https://developer.blender.org/rB8554fa2fad63c20ff0c23894ad0b41087d149a32 GHash, EdgeHash: add debugging function to measure the hash quality Can use to check on improvements to hash functions. === M source/blender/blenlib/BLI_edgehash.h M source/blender/blenlib/BLI_ghash.h M source/blender/blenlib/intern/BLI_ghash.c M source/blender/blenlib/intern/edgehash.c === diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index c0529d9..a5ec69c 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -114,5 +114,9 @@ BLI_INLINE void BLI_edgesetIterator_getKey(EdgeSetIterator *esi, unsigned int *r BLI_INLINE void BLI_edgesetIterator_step(EdgeSetIterator *esi) { BLI_edgehashIterator_step((EdgeHashIterator *)esi); } BLI_INLINE bool BLI_edgesetIterator_isDone(EdgeSetIterator *esi) { return BLI_edgehashIterator_isDone((EdgeHashIterator *)esi); } +#ifdef DEBUG +double BLI_edgehash_calc_quality(EdgeHash *eh); +double BLI_edgeset_calc_quality(EdgeSet *es); +#endif #endif /* __BLI_EDGEHASH_H__ */ diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index a59023d..dc29a12 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -224,6 +224,11 @@ BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi) { return BLI_ghashItera BLI_gsetIterator_done(gs_iter_) == false; \ BLI_gsetIterator_step(gs_iter_), i_++) +#ifdef DEBUG +double BLI_ghash_calc_quality(GHash *gh); +double BLI_gset_calc_quality(GSet *gs); +#endif + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index b30553d..d24c180 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -996,3 +996,39 @@ GSet *BLI_gset_pair_new(const char *info) } /** \} */ + + +/** \name Debugging Introspection + * \{ */ +#ifdef DEBUG + +/** + * Measure how well the hash function performs + * (1.0 is approx as good as random distribution). + */ +double BLI_ghash_calc_quality(GHash *gh) +{ + uint64_t sum = 0; + unsigned int i; + + if (gh-nentries == 0) + return -1.0; + + for (i = 0; i gh-nbuckets; i++) { + uint64_t count = 0; + Entry *e; + for (e = gh-buckets[i]; e; e = e-next) { + count += 1; + } + sum += count * (count + 1); + } + return ((double)sum * (double)gh-nbuckets / + ((double)gh-nentries * (gh-nentries + 2 * gh-nbuckets - 1))); +} +double BLI_gset_calc_quality(GSet *gs) +{ + return BLI_ghash_calc_quality((GHash *)gs); +} + +#endif +/** \} */ diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index aa571bb..b4b3f0d 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -623,3 +623,38 @@ void BLI_edgeset_free(EdgeSet *es) } /** \} */ + +/** \name Debugging Introspection + * \{ */ +#ifdef DEBUG + +/** + * Measure how well the hash function performs + * (1.0 is approx as good as random distribution). + */ +double BLI_edgehash_calc_quality(EdgeHash *eh) +{ + uint64_t sum = 0; + unsigned int i; + + if (eh-nentries == 0) + return -1.0; + + for (i = 0; i eh-nbuckets; i++) { + uint64_t count = 0; + EdgeEntry *e; + for (e = eh-buckets[i]; e; e = e-next) { + count += 1; + } + sum += count * (count + 1); + } + return ((double)sum * (double)eh-nbuckets / + ((double)eh-nentries * (eh-nentries + 2 * eh-nbuckets - 1))); +} +double BLI_edgeset_calc_quality(EdgeSet *es) +{ + return BLI_edgehash_calc_quality((EdgeHash *)es); +} + +#endif +/** \} */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [45f0bd6] master: Feature request:
Commit: 45f0bd6eb1d15aed480fc843ed1c4acc9865abc4 Author: Antony Riakiotakis Date: Mon Jul 14 16:59:35 2014 +0300 https://developer.blender.org/rB45f0bd6eb1d15aed480fc843ed1c4acc9865abc4 Feature request: Expose pressure from event system to python. This will return the tablet pressure, if a tablet is present, or 1.0 if not. === M source/blender/editors/sculpt_paint/paint_stroke.c M source/blender/makesrna/intern/rna_wm.c M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/intern/wm_event_system.c M source/blenderplayer/bad_level_call_stubs/stubs.c === diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index e87f8ca..b336ba7 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -135,26 +135,6 @@ static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata } } -/* if this is a tablet event, return tablet pressure and set *pen_flip - * to 1 if the eraser tool is being used, 0 otherwise */ -static float event_tablet_data(const wmEvent *event, int *pen_flip) -{ - int erasor = 0; - float pressure = 1; - - if (event-tablet_data) { - wmTabletData *wmtab = event-tablet_data; - - erasor = (wmtab-Active == EVT_TABLET_ERASER); - pressure = (wmtab-Active != EVT_TABLET_NONE) ? wmtab-Pressure : 1; - } - - if (pen_flip) - (*pen_flip) = erasor; - - return pressure; -} - static bool paint_tool_require_location(Brush *brush, PaintMode mode) { switch (mode) { @@ -735,7 +715,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) float pressure; /* see if tablet affects event */ - pressure = event_tablet_data(event, stroke-pen_flip); + pressure = WM_event_tablet_data(event, stroke-pen_flip); paint_stroke_add_sample(p, stroke, event-mval[0], event-mval[1], pressure); paint_stroke_sample_average(stroke, sample_average); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 23b6d1e..21df596 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -565,6 +565,12 @@ static int rna_Event_unicode_length(PointerRNA *ptr) } } +static float rna_Event_pressure_get(PointerRNA *ptr) +{ + wmEvent *event = ptr-data; + return WM_event_tablet_data(event, NULL); +} + static PointerRNA rna_PopupMenu_layout_get(PointerRNA *ptr) { struct uiPopupMenu *pup = ptr-data; @@ -1608,6 +1614,10 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, Mouse Previous Y Position, The window relative vertical location of the mouse); + prop = RNA_def_property(srna, pressure, PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_funcs(prop, rna_Event_pressure_get, NULL, NULL); + RNA_def_property_ui_text(prop, Tablet Pressure, The pressure of the tablet or 1.0 if no tablet present); /* modifiers */ prop = RNA_def_property(srna, shift, PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index c9d83a0..4b30d4b 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -449,6 +449,8 @@ voidWM_event_ndof_rotate_get(const struct wmNDOFMotionData *ndof, float float WM_event_ndof_to_axis_angle(const struct wmNDOFMotionData *ndof, float axis[3]); voidWM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4]); +float WM_event_tablet_data(const struct wmEvent *event, int *pen_flip); + #ifdef __cplusplus } #endif diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 03f682a..15be66d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3404,4 +3404,24 @@ void WM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4]) axis_angle_to_quat(q, axis, angle); } +/* if this is a tablet event, return tablet pressure and set *pen_flip + * to 1 if the eraser tool is being used, 0 otherwise */ +float WM_event_tablet_data(const wmEvent *event, int *pen_flip) +{ + int erasor = 0; + float pressure = 1; + + if (event-tablet_data) { + wmTabletData *wmtab = event-tablet_data; + + erasor = (wmtab-Active == EVT_TABLET_ERASER); + pressure = (wmtab-Active != EVT_TABLET_NONE) ?
[Bf-blender-cvs] [48eecec] master: Follow up to previous commit.
Commit: 48eececdba17af7d85fc19480be0e34e38362e66 Author: Antony Riakiotakis Date: Mon Jul 14 17:49:00 2014 +0300 https://developer.blender.org/rB48eececdba17af7d85fc19480be0e34e38362e66 Follow up to previous commit. * Expose is_tablet property to events to determine if event contains tablet data. * Expose tablet tilt for events as a 2D vector in python === M source/blender/editors/sculpt_paint/paint_stroke.c M source/blender/makesrna/intern/rna_wm.c M source/blender/windowmanager/WM_api.h M source/blender/windowmanager/intern/wm_event_system.c M source/blenderplayer/bad_level_call_stubs/stubs.c === diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index b336ba7..5133f51 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -715,7 +715,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) float pressure; /* see if tablet affects event */ - pressure = WM_event_tablet_data(event, stroke-pen_flip); + pressure = WM_event_tablet_data(event, stroke-pen_flip, NULL); paint_stroke_add_sample(p, stroke, event-mval[0], event-mval[1], pressure); paint_stroke_sample_average(stroke, sample_average); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 21df596..996d2d2 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -568,7 +568,19 @@ static int rna_Event_unicode_length(PointerRNA *ptr) static float rna_Event_pressure_get(PointerRNA *ptr) { wmEvent *event = ptr-data; - return WM_event_tablet_data(event, NULL); + return WM_event_tablet_data(event, NULL, NULL); +} + +static int rna_Event_is_tablet_get(PointerRNA *ptr) +{ + wmEvent *event = ptr-data; + return WM_event_is_tablet(event); +} + +static void rna_Event_tilt_get(PointerRNA *ptr, float *values) +{ + wmEvent *event = ptr-data; + WM_event_tablet_data(event, NULL, values); } static PointerRNA rna_PopupMenu_layout_get(PointerRNA *ptr) @@ -1619,6 +1631,17 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_float_funcs(prop, rna_Event_pressure_get, NULL, NULL); RNA_def_property_ui_text(prop, Tablet Pressure, The pressure of the tablet or 1.0 if no tablet present); + prop = RNA_def_property(srna, tilt, PROP_FLOAT, PROP_XYZ_LENGTH); + RNA_def_property_array(prop, 2); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_funcs(prop, rna_Event_tilt_get, NULL, NULL); + RNA_def_property_ui_text(prop, Tablet Tilt, The pressure of the tablet or zeroes if no tablet present); + + prop = RNA_def_property(srna, is_tablet, PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, rna_Event_is_tablet_get, NULL); + RNA_def_property_ui_text(prop, Tablet Pressure, The pressure of the tablet or 1.0 if no tablet present); + /* modifiers */ prop = RNA_def_property(srna, shift, PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, shift, 1); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 4b30d4b..cfa795c 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -449,7 +449,8 @@ voidWM_event_ndof_rotate_get(const struct wmNDOFMotionData *ndof, float float WM_event_ndof_to_axis_angle(const struct wmNDOFMotionData *ndof, float axis[3]); voidWM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4]); -float WM_event_tablet_data(const struct wmEvent *event, int *pen_flip); +float WM_event_tablet_data(const struct wmEvent *event, int *pen_flip, float tilt[2]); +boolWM_event_is_tablet(const struct wmEvent *event); #ifdef __cplusplus } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 15be66d..9f1359d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3406,16 +3406,25 @@ void WM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4]) /* if this is a tablet event, return tablet pressure and set *pen_flip * to 1 if the eraser tool is being used, 0 otherwise */ -float WM_event_tablet_data(const wmEvent *event, int *pen_flip) +float WM_event_tablet_data(const wmEvent *event, int *pen_flip, float tilt[2]) { int erasor = 0; float pressure = 1; + if (tilt) + zero_v2(tilt); + if (event-tablet_data) {
[Bf-blender-cvs] [3a5c074] opensubdiv-modifier: Merge branch 'master' into opensubdiv-modifier
Commit: 3a5c074f57291311314b147288c3e7fc11cbcc99 Author: Sergey Sharybin Date: Mon Jul 14 21:13:27 2014 +0600 https://developer.blender.org/rB3a5c074f57291311314b147288c3e7fc11cbcc99 Merge branch 'master' into opensubdiv-modifier === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8def551] opensubdiv-modifier: OpenSubdiv: Support matcap viewport drawing
Commit: 8def551763565d7154599550f33075e0b0cc659b Author: Sergey Sharybin Date: Mon Jul 14 20:31:09 2014 +0600 https://developer.blender.org/rB8def551763565d7154599550f33075e0b0cc659b OpenSubdiv: Support matcap viewport drawing Matcap display is a part of more generic drawMappedFacesGLSL(), but this doesn't mean GLSL viewport materials are working. For now stuff is only tested and verified for matcap materials, BI/Cycles materials and textures are still not supported. === M source/blender/blenkernel/intern/subsurf_ccg.c === diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 122ed54..45c0b63 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2019,6 +2019,57 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, short (*lnors)[4][3] = dm-getTessFaceDataArray(dm, CD_TESSLOOPNORMAL); int a, i, do_draw, numVerts, matnr, new_matnr, totface; +#ifdef WITH_OPENSUBDIV + { + int i, matnr = -1, shademodel = -1; + CCGFaceIterator *fi; + ccgSubSurf_prepareGLMesh(ss); + do_draw = 0; + for (fi = ccgSubSurf_getFaceIterator(ss), i = 0; +!ccgFaceIterator_isStopped(fi); +ccgFaceIterator_next(fi), ++i) + { + CCGFace *f = ccgFaceIterator_getCurrent(fi); + int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f)); + int origIndex = ccgDM_getFaceMapIndex(ss, f); + int new_matnr, new_shademodel; + + if (faceFlags) { + new_shademodel = (lnors || (faceFlags[index].flag ME_SMOOTH)) + ? GL_SMOOTH + : GL_FLAT; + new_matnr = faceFlags[index].mat_nr; + } + else { + new_shademodel = GL_SMOOTH; + new_matnr = 0; + } + + if (new_shademodel != shademodel) { + glShadeModel(new_shademodel); + shademodel = new_shademodel; + } + + if (new_matnr != matnr) { + do_draw = setMaterial(matnr = new_matnr, gattribs); + matnr = new_matnr; + } + + if (!do_draw || (setDrawOptions (origIndex != ORIGINDEX_NONE) + (setDrawOptions(userData, origIndex) == DM_DRAW_OPTION_SKIP))) + { + continue; + } + + ccgSubSurf_drawGLMesh(ss, true, i); + } + ccgFaceIterator_free(fi); + + /* We're done with drawing if drawing happens using OpenSubdiv. */ + return; + } +#endif + CCG_key_top_level(key, ss); ccgdm_pbvh_update(ccgdm); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9d0d803] blender-tiles: Merge remote-tracking branch 'blender-upstream/master' into blender-tiles
Commit: 9d0d80352774cf487bcbdd166dbd052281bf10dc Author: Jeroen Bakker Date: Mon Jul 14 20:02:17 2014 +0200 https://developer.blender.org/rB9d0d80352774cf487bcbdd166dbd052281bf10dc Merge remote-tracking branch 'blender-upstream/master' into blender-tiles === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [166c858] blender-tiles: linked history of workpackage to tile
Commit: 166c858313343601a175bfae5203a0938f1096ab Author: Jeroen Bakker Date: Mon Jul 14 20:35:08 2014 +0200 https://developer.blender.org/rB166c858313343601a175bfae5203a0938f1096ab linked history of workpackage to tile === M source/blender/compositor/CMakeLists.txt D source/blender/compositor/intern/COM_WorkPackage.cpp D source/blender/compositor/intern/COM_WorkPackage.h M source/blender/compositor/intern/COM_WorkScheduler.h === diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt index 35dbc4c..3a300fa 100644 --- a/source/blender/compositor/CMakeLists.txt +++ b/source/blender/compositor/CMakeLists.txt @@ -82,8 +82,6 @@ set(SRC intern/COM_MemoryBufferValue.h intern/COM_WorkScheduler.cpp intern/COM_WorkScheduler.h - intern/COM_WorkPackage.cpp - intern/COM_WorkPackage.h intern/COM_Tile.cpp intern/COM_Tile.h intern/COM_ChunkOrder.cpp diff --git a/source/blender/compositor/intern/COM_WorkPackage.cpp b/source/blender/compositor/intern/COM_WorkPackage.cpp deleted file mode 100644 index e69de29..000 diff --git a/source/blender/compositor/intern/COM_WorkPackage.h b/source/blender/compositor/intern/COM_WorkPackage.h deleted file mode 100644 index e69de29..000 diff --git a/source/blender/compositor/intern/COM_WorkScheduler.h b/source/blender/compositor/intern/COM_WorkScheduler.h index cec357c..5a90ebe 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.h +++ b/source/blender/compositor/intern/COM_WorkScheduler.h @@ -27,7 +27,6 @@ extern C { # include BLI_threads.h } -#include COM_WorkPackage.h #include COM_defines.h #include COM_Device.h ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [443a1a1] opensubdiv-modifier: OpenSubdiv: Fix CCGDM drawing when not using GPU backend
Commit: 443a1a167ba9da78887de8c546e00cf853fc1288 Author: Sergey Sharybin Date: Mon Jul 14 22:47:25 2014 +0600 https://developer.blender.org/rB443a1a167ba9da78887de8c546e00cf853fc1288 OpenSubdiv: Fix CCGDM drawing when not using GPU backend === M source/blender/blenkernel/BKE_subsurf.h M source/blender/blenkernel/intern/subsurf_ccg.c === diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h index 91ab9e5..c2a07ac 100644 --- a/source/blender/blenkernel/BKE_subsurf.h +++ b/source/blender/blenkernel/BKE_subsurf.h @@ -103,7 +103,7 @@ typedef struct CCGDerivedMesh { struct CCGSubSurf *ss; int freeSS; - int drawInteriorEdges, useSubsurfUv; + int drawInteriorEdges, useSubsurfUv, useGpuBackend; struct {int startVert; struct CCGVert *vert; } *vertMap; struct {int startVert; int startEdge; struct CCGEdge *edge; } *edgeMap; diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 45c0b63..dfe2e1e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1661,7 +1661,7 @@ static void ccgDM_drawEdges(DerivedMesh *dm, bool drawLooseEdges, bool drawAllEd int useAging; #ifdef WITH_OPENSUBDIV - { + if (ccgdm-useGpuBackend) { /* TODO(sergey): We currently only support all edges drawing. */ ccgSubSurf_prepareGLMesh(ss); ccgSubSurf_drawGLMesh(ss, false, -1); @@ -1786,7 +1786,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) int drawcurrent = 0, matnr = -1, shademodel = -1; #ifdef WITH_OPENSUBDIV - { + if (ccgdm-useGpuBackend) { int i, matnr = -1, shademodel = -1; CCGFaceIterator *fi; ccgSubSurf_prepareGLMesh(ss); @@ -2020,7 +2020,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int a, i, do_draw, numVerts, matnr, new_matnr, totface; #ifdef WITH_OPENSUBDIV - { + if (ccgdm-useGpuBackend) { int i, matnr = -1, shademodel = -1; CCGFaceIterator *fi; ccgSubSurf_prepareGLMesh(ss); @@ -4013,6 +4013,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, ccgdm-ss = ss; ccgdm-drawInteriorEdges = drawInteriorEdges; ccgdm-useSubsurfUv = useSubsurfUv; + ccgdm-useGpuBackend = use_gpu_backend; /* CDDM hack. */ ccgdm-edgeFlags = MEM_callocN(sizeof(short) * totedge, edgeFlags); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5897c67] blender-tiles: First implementation of the samplers. Refactored the read methods from the buffers to wpecialized classes. these classes can be optimized locally.
Commit: 5897c6799c3ae48e2e3a5d2e3f22a884b8f04f01 Author: Jeroen Bakker Date: Mon Jul 14 23:01:35 2014 +0200 https://developer.blender.org/rB5897c6799c3ae48e2e3a5d2e3f22a884b8f04f01 First implementation of the samplers. Refactored the read methods from the buffers to wpecialized classes. these classes can be optimized locally. next step: remove the read methods from the buffer. they should al go through the samplers of the buffers === M source/blender/compositor/CMakeLists.txt M source/blender/compositor/intern/COM_MemoryBuffer.cpp M source/blender/compositor/intern/COM_MemoryBuffer.h M source/blender/compositor/intern/COM_MemoryBufferColor.cpp M source/blender/compositor/intern/COM_MemoryBufferColor.h M source/blender/compositor/intern/COM_MemoryBufferValue.cpp M source/blender/compositor/intern/COM_MemoryBufferValue.h M source/blender/compositor/intern/COM_MemoryBufferVector.cpp M source/blender/compositor/intern/COM_MemoryBufferVector.h A source/blender/compositor/intern/COM_Sampler.cpp A source/blender/compositor/intern/COM_Sampler.h === diff --git a/source/blender/compositor/CMakeLists.txt b/source/blender/compositor/CMakeLists.txt index 3a300fa..6ff0d19 100644 --- a/source/blender/compositor/CMakeLists.txt +++ b/source/blender/compositor/CMakeLists.txt @@ -80,6 +80,8 @@ set(SRC intern/COM_MemoryBufferVector.h intern/COM_MemoryBufferValue.cpp intern/COM_MemoryBufferValue.h + intern/COM_Sampler.cpp + intern/COM_Sampler.h intern/COM_WorkScheduler.cpp intern/COM_WorkScheduler.h intern/COM_Tile.cpp diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 05e8a0d..55c819f 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -192,6 +192,7 @@ float MemoryBuffer::getMaximumValue(rcti *rect) MemoryBuffer::~MemoryBuffer() { + this-deinit_samplers(); if (this-m_buffer) { MEM_freeN(this-m_buffer); this-m_buffer = NULL; diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 8eddcb9..60dee84 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -119,6 +119,7 @@ protected: * @param num_channels Number of channels that must be allocated for every pixel */ MemoryBuffer(DataType datatype, rcti *rect, unsigned int num_channels); + public: /** * @brief factory method for the constructor, selecting the right subclass @@ -191,7 +192,9 @@ public: } } - virtual void read(float *result, int x, int y, + virtual void init_samplers() {} + virtual void deinit_samplers() {} + virtual void read(float *result, int x, int y, MemoryBufferExtend extend_x = COM_MB_CLIP, MemoryBufferExtend extend_y = COM_MB_CLIP) = 0; diff --git a/source/blender/compositor/intern/COM_MemoryBufferColor.cpp b/source/blender/compositor/intern/COM_MemoryBufferColor.cpp index 1513e2a..6bbe56c 100644 --- a/source/blender/compositor/intern/COM_MemoryBufferColor.cpp +++ b/source/blender/compositor/intern/COM_MemoryBufferColor.cpp @@ -27,17 +27,32 @@ MemoryBufferColor::MemoryBufferColor(MemoryProxy *memoryProxy, unsigned int chunkNumber, rcti *rect): MemoryBuffer(memoryProxy, chunkNumber, rect, NUMBER_OF_CHANNELS) { + this-init_samplers(); + } MemoryBufferColor::MemoryBufferColor(MemoryProxy *memoryProxy, rcti *rect) : MemoryBuffer(memoryProxy, rect, NUMBER_OF_CHANNELS) { + this-init_samplers(); } MemoryBufferColor::MemoryBufferColor(DataType datatype, rcti *rect) : MemoryBuffer(datatype, rect, NUMBER_OF_CHANNELS) { + this-init_samplers(); +} + +void MemoryBufferColor::init_samplers() { + this-m_sampler_nearest = new SamplerNearestColor(this); + this-m_sampler_nocheck = new SamplerNearestNoCheckColor(this); + this-m_sampler_bilinear = new SamplerBilinearColor(this); } +void MemoryBufferColor::deinit_samplers() { + delete this-m_sampler_nearest; + delete this-m_sampler_nocheck; + delete this-m_sampler_bilinear; +} MemoryBuffer *MemoryBufferColor::duplicate() { @@ -69,79 +84,24 @@ void MemoryBufferColor::addPixel(int x, int y, const float *color) // --- SAMPLERS --- inline void MemoryBufferColor::read(float *result, int x, int y, -MemoryBufferExtend extend_x, -MemoryBufferExtend extend_y) +
[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61375] trunk/lib/ darwin-9.x.universal/ffmpeg/lib: Update ffmpeg libs with new functions: --enable-network --enable-protocol=tcp --enable-demux
Revision: 61375 https://developer.blender.org/rBL61375 Author: jensverwiebe Date: 2014-07-14 22:32:16 + (Mon, 14 Jul 2014) Log Message: --- Update ffmpeg libs with new functions: --enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264 Modified Paths: -- trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavcodec.a trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavdevice.a trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavformat.a trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavutil.a trunk/lib/darwin-9.x.universal/ffmpeg/lib/libpostproc.a trunk/lib/darwin-9.x.universal/ffmpeg/lib/libswscale.a Modified: trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavcodec.a === (Binary files differ) Modified: trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavdevice.a === (Binary files differ) Modified: trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavformat.a === (Binary files differ) Modified: trunk/lib/darwin-9.x.universal/ffmpeg/lib/libavutil.a === (Binary files differ) Modified: trunk/lib/darwin-9.x.universal/ffmpeg/lib/libpostproc.a === (Binary files differ) Modified: trunk/lib/darwin-9.x.universal/ffmpeg/lib/libswscale.a === (Binary files differ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61376] trunk/lib/ darwin-9.x.universal/ffmpeg/compiling_2.1.4.txt: OS/ffmpeg: update the README for compiling_2.1.4
Revision: 61376 https://developer.blender.org/rBL61376 Author: jensverwiebe Date: 2014-07-14 22:36:04 + (Mon, 14 Jul 2014) Log Message: --- OS/ffmpeg: update the README for compiling_2.1.4 Modified Paths: -- trunk/lib/darwin-9.x.universal/ffmpeg/compiling_2.1.4.txt Modified: trunk/lib/darwin-9.x.universal/ffmpeg/compiling_2.1.4.txt === --- trunk/lib/darwin-9.x.universal/ffmpeg/compiling_2.1.4.txt 2014-07-14 22:32:16 UTC (rev 61375) +++ trunk/lib/darwin-9.x.universal/ffmpeg/compiling_2.1.4.txt 2014-07-14 22:36:04 UTC (rev 61376) @@ -1,7 +1,7 @@ x86_64 -./configure --prefix=/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/ffmpeg-2.1.4_x86_64/Blender --disable-yasm --arch=x86_64 --disable-shared --enable-gpl --enable-zlib --disable-ffserver --disable-ffplay --enable-swscale --disable-avfilter --enable-encoder=prores --enable-encoder=yuv4 --enable-encoder=v410 --enable-encoder=v308 --enable-encoder=210 --enable-decoder=prores --enable-decoder=yuv4 --enable-decoder=v410 --enable-decoder=v308 --enable-decoder=210 --enable-memalign-hack --enable-pthreads --disable-outdevs --disable-demuxer=alsa --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libtheora --enable-libvorbis --extra-cflags='-stdlib=libstdc++ -O3 -arch x86_64 -mmacosx-version-min=10.6 -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/x264-snapshot-20120129-2245 -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/lame-3.98.4/Blender/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/xvidcore/src -I/Volumes/Workdata/Blender/LIB_Sources/F FMPG_RED O/libvorbis-1.3.2/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libtheora-1.1.1/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libogg-1.2.1/include' --extra-ldflags='-arch x86_64 -mmacosx-version-min=10.6 -L/Volumes/Workdata/Blender/Development/lib/darwin-9.x.universal/ffmpeg/lib' +./configure --prefix=/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/ffmpeg-2.1.4_x86_64/Blender --disable-yasm --arch=x86_64 --disable-shared --enable-gpl --enable-network --enable-protocol=tcp --enable-demuxer=rtsp --enable-decoder=h264 --enable-zlib --disable-ffserver --disable-ffplay --enable-swscale --disable-avfilter --enable-encoder=prores --enable-encoder=yuv4 --enable-encoder=v410 --enable-encoder=v308 --enable-encoder=210 --enable-decoder=prores --enable-decoder=yuv4 --enable-decoder=v410 --enable-decoder=v308 --enable-decoder=210 --enable-memalign-hack --enable-pthreads --disable-outdevs --disable-demuxer=alsa --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libtheora --enable-libvorbis --extra-cflags='-stdlib=libstdc++ -O3 -arch x86_64 -mmacosx-version-min=10.6 -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/x264-snapshot-20120129-2245 -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/lame-3.98.4/Blender/include -I/Volumes/Workdata/Bl ender/LI B_Sources/FFMPG_REDO/xvidcore/src -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libvorbis-1.3.2/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libtheora-1.1.1/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libogg-1.2.1/include' --extra-ldflags='-arch x86_64 -mmacosx-version-min=10.6 -L/Volumes/Workdata/Blender/Development/lib/darwin-9.x.universal/ffmpeg/lib' i386 -./configure --prefix=/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/ffmpeg-2.1.4_i386/Blender --disable-yasm --arch=i386 --disable-shared --enable-gpl --enable-zlib --disable-ffserver --disable-ffplay --enable-swscale --disable-avfilter --enable-encoder=prores --enable-encoder=yuv4 --enable-encoder=v410 --enable-encoder=v308 --enable-encoder=210 --enable-decoder=prores --enable-decoder=yuv4 --enable-decoder=v410 --enable-decoder=v308 --enable-decoder=210 --enable-memalign-hack --enable-pthreads --disable-outdevs --disable-demuxer=alsa --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libtheora --enable-libvorbis --extra-cflags='-stdlib=libstdc++ -O3 -arch i386 -mmacosx-version-min=10.6 -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/x264-snapshot-20120129-2245 -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/lame-3.98.4/Blender/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/xvidcore/src -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_R EDO/libv orbis-1.3.2/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libtheora-1.1.1/include -I/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/libogg-1.2.1/include' --extra-ldflags='-arch i386 -mmacosx-version-min=10.6 -L/Volumes/Workdata/Blender/Development/lib/darwin-9.x.universal/ffmpeg/lib' \ No newline at end of file +./configure --prefix=/Volumes/Workdata/Blender/LIB_Sources/FFMPG_REDO/ffmpeg-2.1.4_i386/Blender --disable-yasm --arch=i386 --disable-shared --enable-gpl --enable-network --enable-protocol=tcp --enable-demuxer=rtsp
[Bf-blender-cvs] [bb4a489] soc-2013-paint: Use BKE_libblock_find_name
Commit: bb4a489d54570eb95940a39c4098fa1a0332530d Author: Campbell Barton Date: Tue Jul 15 09:19:24 2014 +1000 https://developer.blender.org/rBbb4a489d54570eb95940a39c4098fa1a0332530d Use BKE_libblock_find_name === M source/blender/editors/interface/resources.c === diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index dbb10ab..2ea3e19 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -53,6 +53,7 @@ #include BKE_global.h #include BKE_main.h #include BKE_texture.h +#include BKE_library.h #include BIF_gl.h @@ -2480,12 +2481,10 @@ void init_userdef_factory(void) br-imagepaint_tool = PAINT_TOOL_FILL; br-ob_mode = OB_MODE_TEXTURE_PAINT; - for (br = G.main-brush.first; br; br = br-id.next) { - if (strcmp(br-id.name, BRMask) == 0) { - br-imagepaint_tool = PAINT_TOOL_MASK; - br-ob_mode |= OB_MODE_TEXTURE_PAINT; - break; - } + br = (Brush *)BKE_libblock_find_name(ID_BR, Mask); + if (br) { + br-imagepaint_tool = PAINT_TOOL_MASK; + br-ob_mode |= OB_MODE_TEXTURE_PAINT; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1bf87fa] master: BGE: TrackTo actuator: increasing up track axis options
Commit: 1bf87fa26c6763ef282ec39b07b678723a7f389b Author: Jorge Bernal Date: Mon Jul 14 17:36:56 2014 -0700 https://developer.blender.org/rB1bf87fa26c6763ef282ec39b07b678723a7f389b BGE: TrackTo actuator: increasing up track axis options This is related to Task T34861 to increase up track axis options for TrackTo actuator. I've just added it to differential to facilitate an easier review. With the patch applied you can select X, Y and Z axis for the Up axis, and X, Y, Z, -X, -Y and -Z for the track axis. Related to the implementation I have used the algorithm from Trackto constrain placed in constrain.c but adapted to be used with MOTO library. The wiki docs are here (http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator). Test file is here: {F97623} I have also uploaded 2 screenshots showing the UI modifications to the TrackTo actuator: {F91992} {F91990} Reviewers: moguri, dfelinto Reviewed By: moguri CC: Genome36 Differential Revision: https://developer.blender.org/D565 === M doc/python_api/rst/bge.logic.rst M doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst M intern/moto/include/MT_Matrix3x3.h M intern/moto/include/MT_Vector3.h M intern/moto/include/MT_Vector3.inl M release/scripts/startup/bl_ui/properties_object.py M source/blender/blenkernel/BKE_blender.h M source/blender/blenkernel/intern/sca.c M source/blender/blenloader/intern/versioning_270.c M source/blender/editors/space_logic/logic_window.c M source/blender/makesdna/DNA_actuator_types.h M source/blender/makesrna/intern/rna_actuator.c M source/gameengine/Converter/KX_ConvertActuators.cpp M source/gameengine/Ketsji/KX_PythonInit.cpp M source/gameengine/Ketsji/KX_TrackToActuator.cpp M source/gameengine/Ketsji/KX_TrackToActuator.h === diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst index 4e0d317..d901a4e 100644 --- a/doc/python_api/rst/bge.logic.rst +++ b/doc/python_api/rst/bge.logic.rst @@ -868,6 +868,23 @@ See :class:`bge.types.KX_SteeringActuator.behavior` :value: 3 +.. _logic-trackto-actuator: + +- +TrackTo Actuator +- + +See :class:`bge.types.KX_TrackToActuator` + +.. data:: KX_TRACK_UPAXIS_POS_X +.. data:: KX_TRACK_UPAXIS_POS_Y +.. data:: KX_TRACK_UPAXIS_POS_Z +.. data:: KX_TRACK_TRAXIS_POS_X +.. data:: KX_TRACK_TRAXIS_POS_Y +.. data:: KX_TRACK_TRAXIS_POS_Z +.. data:: KX_TRACK_TRAXIS_NEG_X +.. data:: KX_TRACK_TRAXIS_NEG_Y +.. data:: KX_TRACK_TRAXIS_NEG_Z === Various diff --git a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst index 070243c..5b5c5d0 100644 --- a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst +++ b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst @@ -37,3 +37,25 @@ base class --- :class:`SCA_IActuator` :type: boolean + .. attribute:: upAxis + + The axis that points upward. + + :type: integer from 0 to 2 + + * KX_TRACK_UPAXIS_POS_X + * KX_TRACK_UPAXIS_POS_Y + * KX_TRACK_UPAXIS_POS_Z + + .. attribute:: trackAxis + + The axis that points to the target object. + + :type: integer from 0 to 5 + + * KX_TRACK_TRAXIS_POS_X + * KX_TRACK_TRAXIS_POS_Y + * KX_TRACK_TRAXIS_POS_Z + * KX_TRACK_TRAXIS_NEG_X + * KX_TRACK_TRAXIS_NEG_Y + * KX_TRACK_TRAXIS_NEG_Z diff --git a/intern/moto/include/MT_Matrix3x3.h b/intern/moto/include/MT_Matrix3x3.h index 6d709fa..17dd533 100644 --- a/intern/moto/include/MT_Matrix3x3.h +++ b/intern/moto/include/MT_Matrix3x3.h @@ -84,11 +84,18 @@ public: MT_Vector3 getColumn(int i) const { return MT_Vector3(m_el[0][i], m_el[1][i], m_el[2][i]); } + void setColumn(int i, const MT_Vector3 v) { m_el[0][i] = v[0]; m_el[1][i] = v[1]; m_el[2][i] = v[2]; } + + void setRow(int i, const MT_Vector3 v) { + m_el[i][0] = v[0]; + m_el[i][1] = v[1]; + m_el[i][2] = v[2]; + } void setValue(const float *m) { m_el[0][0] = *m++; m_el[1][0] = *m++; m_el[2][0] = *m++; m++; diff --git a/intern/moto/include/MT_Vector3.h b/intern/moto/include/MT_Vector3.h index 83c53a1..b06f345 100644 --- a/intern/moto/include/MT_Vector3.h +++ b/intern/moto/include/MT_Vector3.h @@ -75,7 +75,7 @@ public: voidnormalize(); MT_Vector3 normalized() const; MT_Vector3 safe_normalized() const; - + MT_Vector3 safe_normalized_vec(MT_Vector3 vecnormalized) const; voidscale(MT_Scalar x, MT_Scalar y, MT_Scalar z); MT_Vector3 scaled(MT_Scalar x, MT_Scalar y,
[Bf-blender-cvs] [dbc79e7] master: Fix T41074: Several Mouse Look actuators not working well together when reset button are set in one or several of them
Commit: dbc79e7aba4881cd3e61ad60433ef834965b6799 Author: Mitchell Stokes Date: Mon Jul 14 18:36:27 2014 -0700 https://developer.blender.org/rBdbc79e7aba4881cd3e61ad60433ef834965b6799 Fix T41074: Several Mouse Look actuators not working well together when reset button are set in one or several of them Fix provided by lordloki (Jorge Bernal) === M source/gameengine/Ketsji/KX_MouseActuator.cpp === diff --git a/source/gameengine/Ketsji/KX_MouseActuator.cpp b/source/gameengine/Ketsji/KX_MouseActuator.cpp index 3d74bd7..aae5d18 100644 --- a/source/gameengine/Ketsji/KX_MouseActuator.cpp +++ b/source/gameengine/Ketsji/KX_MouseActuator.cpp @@ -208,6 +208,9 @@ bool KX_MouseActuator::Update() parent-ApplyRotation(rotation, m_local_x); } } + else { + setposition[0] = 0.5; + } //Calculating Y axis. if (m_use_axis_y) { @@ -266,6 +269,9 @@ bool KX_MouseActuator::Update() parent-ApplyRotation(rotation, m_local_y); } } + else { + setposition[1] = 0.5; + } setMousePosition(setposition[0], setposition[1]); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fa8ff63] master: Edgehash: Improve magic number for hashing
Commit: fa8ff63b48d2064701e1cc9929549c79c5dd73c3 Author: Campbell Barton Date: Tue Jul 15 13:06:33 2014 +1000 https://developer.blender.org/rBfa8ff63b48d2064701e1cc9929549c79c5dd73c3 Edgehash: Improve magic number for hashing Gives consistently better results. Tested with wide variety of meshes. === M source/blender/blenlib/intern/edgehash.c === diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index b4b3f0d..27c5457 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -93,7 +93,7 @@ BLI_INLINE unsigned int edgehash_keyhash(EdgeHash *eh, unsigned int v0, unsigned { BLI_assert(v0 v1); - return ((v0 * 39) ^ (v1 * 31)) % eh-nbuckets; + return ((v0 * 65) ^ (v1 * 31)) % eh-nbuckets; } /** ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs