[Bf-blender-cvs] [6fe23b6] master: Use clamp to border for brushes or textures can leak after rotating texture coordinates of brushes (in rake mode).
Commit: 6fe23b60dd2c4e3a63905a2a52d0f6093b8d5dda Author: Antony Riakiotakis Date: Wed Feb 18 11:59:55 2015 +0100 Branches: master https://developer.blender.org/rB6fe23b60dd2c4e3a63905a2a52d0f6093b8d5dda Use clamp to border for brushes or textures can leak after rotating texture coordinates of brushes (in rake mode). === M source/blender/editors/sculpt_paint/paint_cursor.c === diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 2d425b7..cf3f682 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -341,8 +341,8 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); if (mtex-brush_map_mode == MTEX_MAP_MODE_VIEW) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); } BKE_paint_reset_overlay_invalid(invalid); @@ -464,8 +464,8 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); BKE_paint_reset_overlay_invalid(PAINT_INVALID_OVERLAY_CURVE); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6920735] master: Include SDL information in system info text.
Commit: 6920735cff6b5b2ab9e4e6d8090fb48bba7d9ba4 Author: Sybren A. Stüvel Date: Wed Feb 18 12:07:48 2015 +0100 Branches: master https://developer.blender.org/rB6920735cff6b5b2ab9e4e6d8090fb48bba7d9ba4 Include SDL information in system info text. Adds bpy.app.sdl to expose SDL version information. When SDL is not available on a Linux system, certain Blender features are silently disabled (like joystick support in the BGE). This change is the first step towards making it more obvious why something isn't working. SDL information is exposed to Python via bpy.app.sdl, in the same way as OCIO and OIIO information is exposed. Generated system-info.txt contains SDL loading method (linked or dynamically loaded by Blender) and SDL version number. Reviewed by: sergey, campbellbarton Differential Revision: https://developer.blender.org/D1112 === M release/scripts/modules/sys_info.py M source/blender/python/SConscript M source/blender/python/intern/CMakeLists.txt M source/blender/python/intern/bpy_app.c M source/blender/python/intern/bpy_app_build_options.c A source/blender/python/intern/bpy_app_sdl.c A source/blender/python/intern/bpy_app_sdl.h === diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 74a6f4c..1b63d1d 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -118,6 +118,18 @@ def write_sysinfo(op): else: output.write(Blender was built without FFmpeg support\n) +if bpy.app.build_options.sdl: +output.write(\nSDL\n) +output.write(lilies) +output.write(Version: %s\n % bpy.app.sdl.version_string) +output.write(Loading method: ) +if bpy.app.build_options.sdl_dynload: +output.write(dynamically loaded by Blender (WITH_SDL_DYNLOAD=ON)\n) +else: +output.write(linked (WITH_SDL_DYNLOAD=OFF)\n) +if not bpy.app.sdl.available: +output.write(WARNING: Blender could not load SDL library\n) + output.write(\nOther Libraries:\n) output.write(lilies) ocio = bpy.app.ocio @@ -148,6 +160,9 @@ def write_sysinfo(op): else: output.write(Blender was built without Cycles support\n) +if not bpy.app.build_options.sdl: +output.write(SDL: Blender was built without SDL support\n) + if bpy.app.background: output.write(\nOpenGL: missing, background mode\n) else: diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 9988e09..5f032f2 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -159,6 +159,11 @@ if env['WITH_BF_OPENAL']: if env['WITH_BF_SDL']: defs.append('WITH_SDL') +incs += ' ' + env['BF_SDL_INC'] + +if env['WITH_BF_SDL_DYNLOAD']: +defs.append('WITH_SDL_DYNLOAD') +incs += ' #extern/sdlew/include' if env['WITH_BF_JACK']: defs.append('WITH_JACK') diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index a75db23..8f85dbe 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -52,6 +52,7 @@ set(SRC bpy_app_handlers.c bpy_app_ocio.c bpy_app_oiio.c + bpy_app_sdl.c bpy_app_translations.c bpy_driver.c bpy_interface.c @@ -210,9 +211,19 @@ if(WITH_OPENAL) endif() if(WITH_SDL) + list(APPEND INC_SYS + ${SDL_INCLUDE_DIR} + ) add_definitions(-DWITH_SDL) endif() +if(WITH_SDL_DYNLOAD) + list(APPEND INC + ../../../../extern/sdlew/include + ) +add_definitions(-DWITH_SDL_DYNLOAD) +endif() + if(WITH_JACK) add_definitions(-DWITH_JACK) endif() diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index cca4191..c8a4971 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -36,6 +36,7 @@ #include bpy_app_ffmpeg.h #include bpy_app_ocio.h #include bpy_app_oiio.h +#include bpy_app_sdl.h #include bpy_app_build_options.h #include bpy_app_translations.h @@ -97,6 +98,7 @@ static PyStructSequence_Field app_info_fields[] = { {(char *)ffmpeg, (char *)FFmpeg library information backend}, {(char *)ocio, (char *)OpenColorIO library information backend}, {(char *)oiio, (char *)OpenImageIO library information backend}, + {(char *)sdl, (char *)SDL library information backend}, {(char *)build_options, (char *)A set containing most important enabled optional build features}, {(char *)handlers, (char *)Application handler callbacks}, {(char *)translations, (char *)Application and addons internationalization API}, @@ -173,6 +175,7 @@ static PyObject
[Bf-blender-cvs] [7f7413b] master: Cleanup: Use bools in BVHParams class.
Commit: 7f7413bce24ea21cd5e47f307d84d20606ac349c Author: Thomas Dinges Date: Wed Feb 18 12:05:33 2015 +0100 Branches: master https://developer.blender.org/rB7f7413bce24ea21cd5e47f307d84d20606ac349c Cleanup: Use bools in BVHParams class. === M intern/cycles/bvh/bvh_params.h === diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h index 3fa6ebd..99bfd94 100644 --- a/intern/cycles/bvh/bvh_params.h +++ b/intern/cycles/bvh/bvh_params.h @@ -28,7 +28,7 @@ class BVHParams { public: /* spatial split area threshold */ - int use_spatial_split; + bool use_spatial_split; float spatial_split_alpha; /* SAH costs */ @@ -41,13 +41,13 @@ public: int max_curve_leaf_size; /* object or mesh level bvh */ - int top_level; + bool top_level; /* disk cache */ - int use_cache; + bool use_cache; /* QBVH */ - int use_qbvh; + bool use_qbvh; /* fixed parameters */ enum { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [66affa5] fracture_modifier: fix: cutter groups should work mostly now
Commit: 66affa5cf39e577ea98e30d0a0b26a24341db792 Author: Martin Felke Date: Wed Feb 18 11:57:24 2015 +0100 Branches: fracture_modifier https://developer.blender.org/rB66affa5cf39e577ea98e30d0a0b26a24341db792 fix: cutter groups should work mostly now === M source/blender/blenkernel/intern/fracture.c M source/blender/blenkernel/intern/fracture_util.c === diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c index 97cb54b..1b0be06 100644 --- a/source/blender/blenkernel/intern/fracture.c +++ b/source/blender/blenkernel/intern/fracture.c @@ -836,16 +836,17 @@ void BKE_fracture_shard_by_planes(FractureModifierData *fmd, Object *obj, short Shard *t = NULL; Shard *s = NULL; + printf(Cutting with %s ...\n, ob-id.name); /*simple caseone cutter object per object*/ - if (ob-type == OB_MESH) - { - int i = 0, j = 0, k = 0, count = 0; + if (ob-type == OB_MESH) { + int i = 0, k = 0, count = 0; DerivedMesh *d; MVert *mv; + int *shard_counts = NULL; + bool is_zero = false; d = ob-derivedFinal; - if (d == NULL) - { + if (d == NULL) { d = CDDM_from_mesh(ob-data); } @@ -862,11 +863,10 @@ void BKE_fracture_shard_by_planes(FractureModifierData *fmd, Object *obj, short } count = fmd-frac_mesh-shard_count; + //printf(Count: %d\n, count); - if (count == 0) - { - if (obj-derivedFinal != NULL) - { + if (count == 0) { + if (obj-derivedFinal != NULL) { dm_parent = CDDM_copy(obj-derivedFinal); } @@ -875,23 +875,22 @@ void BKE_fracture_shard_by_planes(FractureModifierData *fmd, Object *obj, short } count = 1; + is_zero = true; } - for (k = 0; k count; k++) - { - /*just keep appending items at the end here */ + shard_counts = MEM_mallocN(sizeof(int) * count, shard_counts); + for (k = 0; k count; k++) { + /*just keep appending items at the end here */ MPoly *mpoly, *mp; - int totpoly, totvert; + int totpoly; Shard *parent = NULL; - if (count 1) - { + if (is_zero == false) { parent = BLI_findlink(fmd-frac_mesh-shard_map, k); dm_parent = BKE_shard_create_dm(parent, true); } - totvert = dm_parent-getNumVerts(dm_parent); mpoly = dm_parent-getPolyArray(dm_parent); totpoly = dm_parent-getNumPolys(dm_parent); for (i = 0, mp = mpoly; i totpoly; i++, mp++) { @@ -899,24 +898,20 @@ void BKE_fracture_shard_by_planes(FractureModifierData *fmd, Object *obj, short } s = BKE_fracture_shard_boolean(obj, dm_parent, t, inner_material_index, 0, 0.0f, s2, NULL, 0.0f, false, 0); - if (s != NULL) - { + if (s != NULL) { add_shard(fmd-frac_mesh, s, mat); shards++; s = NULL; } - if (s2 != NULL) -
[Bf-blender-cvs] [3cb9ec1] gooseberry: New option use signed distance for force fields with surface shape.
Commit: 3cb9ec18440c3309d9404d9a1cb4e36097c6ccbd Author: Lukas Tönne Date: Wed Feb 18 12:22:59 2015 +0100 Branches: gooseberry https://developer.blender.org/rB3cb9ec18440c3309d9404d9a1cb4e36097c6ccbd New option use signed distance for force fields with surface shape. By default a surface-based force will push things away from the surface in both directions, regardless of whether a point is inside or outside (judging by the surface normal). The new option makes a force field always push things away in the direction of the normal, so that it becomes less likely to get points trapped inside a mesh object. === M release/scripts/startup/bl_ui/properties_physics_common.py M source/blender/blenkernel/intern/effect.c M source/blender/makesdna/DNA_object_force.h M source/blender/makesrna/intern/rna_object_force.c === diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index bb0f0cf..19533d2 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -315,5 +315,8 @@ def basic_force_field_falloff_ui(self, context, field): sub.active = field.use_max_distance sub.prop(field, distance_max, text=Maximum) +if field.shape == 'SURFACE': +layout.prop(field, use_signed_distance) + if __name__ == __main__: # only for live edit. bpy.utils.register_module(__name__) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 76a39fe..a9bf499 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -831,6 +831,10 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected } copy_v3_v3(force, efd-vec_to_point); + if (pd-shape == PFIELD_SHAPE_SURFACE (pd-flag PFIELD_USE_SIGNED_DISTANCE)) { + if (dot_v3v3(efd-vec_to_point, efd-nor) 0.0f) + mul_v3_fl(force, -1.0f); + } switch (pd-forcefield) { case PFIELD_WIND: diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 5cc56d8..fac8443 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -370,6 +370,7 @@ typedef struct SoftBody { #define PFIELD_DO_ROTATION (115) #define PFIELD_GUIDE_PATH_WEIGHT (116) /* apply curve weights */ #define PFIELD_SMOKE_DENSITY(117)/* multiply smoke force by density */ +#define PFIELD_USE_SIGNED_DISTANCE (118) /* surface shape: use negative distance on the interior */ /* pd-falloff */ #define PFIELD_FALL_SPHERE 0 diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 4cc098f..ac74c7e 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -1337,6 +1337,11 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_ui_text(prop, Use Max, Use a maximum distance for the field to work); RNA_def_property_update(prop, 0, rna_FieldSettings_update); + prop = RNA_def_property(srna, use_signed_distance, PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, flag, PFIELD_USE_SIGNED_DISTANCE); + RNA_def_property_ui_text(prop, Use Signed Distance, Use negative distance on the interior of surface shapes); + RNA_def_property_update(prop, 0, rna_FieldSettings_update); + prop = RNA_def_property(srna, use_radial_min, PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, flag, PFIELD_USEMINR); RNA_def_property_ui_text(prop, Use Min, Use a minimum radial distance for the field's fall-off); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [58ffd8b] gooseberry: Always make sure the surface modifier has tessfaces available for building the BVH.
Commit: 58ffd8beb3342a73422a5c0a24a04f3fbe299806 Author: Lukas Tönne Date: Wed Feb 18 11:49:04 2015 +0100 Branches: gooseberry https://developer.blender.org/rB58ffd8beb3342a73422a5c0a24a04f3fbe299806 Always make sure the surface modifier has tessfaces available for building the BVH. A long long time ago (rB3816554cbc1a40dc5199c8e56e45817ec09128d5) it was coded such that edges would be used instead of faces for surface distance calculation. This is pretty much never what you actually want. === M source/blender/modifiers/intern/MOD_surface.c === diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 1c462f1..36a1759 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -111,6 +111,7 @@ static void deformVerts(ModifierData *md, Object *ob, float *vec; MVert *x, *v; + DM_ensure_tessface(surmd-dm); CDDM_apply_vert_coords(surmd-dm, vertexCos); CDDM_calc_normals(surmd-dm); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2967253] master: Fix Windows build.
Commit: 2967253ae4f080a4968d6542409c608c1b1fcb41 Author: Bastien Montagne Date: Wed Feb 18 12:16:31 2015 +0100 Branches: master https://developer.blender.org/rB2967253ae4f080a4968d6542409c608c1b1fcb41 Fix Windows build. Mighty M$VC never heard of 'strcasecmp' family of functions, it prefers its own names, as usual... === M source/blender/blenlib/BLI_utildefines.h === diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 079352f..de91332 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -515,6 +515,11 @@ extern C { /* generic strcmp macros */ +#if defined(_MSC_VER) +# define strcasecmp _stricmp +# define strncasecmp _strnicmp +#endif + #define STREQ(a, b) (strcmp(a, b) == 0) #define STRCASEEQ(a, b) (strcasecmp(a, b) == 0) #define STREQLEN(a, b, n) (strncmp(a, b, n) == 0) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [839a6b2] master: Fix T43716 regression in mask modifier - edges could access out of bounds indices of vertices.
Commit: 839a6b22d6c3750b0c8a98ccdb50d57e475ec754 Author: Antony Riakiotakis Date: Wed Feb 18 17:58:57 2015 +0100 Branches: master https://developer.blender.org/rB839a6b22d6c3750b0c8a98ccdb50d57e475ec754 Fix T43716 regression in mask modifier - edges could access out of bounds indices of vertices. Issue here is that if we copy edge customdata the MEdge data that were previously written get overwritten, solution is to write indices and flags last (probably writing flags is superfluous here). === M source/blender/modifiers/intern/MOD_mask.c === diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 59348c5..c1d4e41 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -293,7 +293,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, mloop_dst = CDDM_get_loops(result); medge_dst = CDDM_get_edges(result); mvert_dst = CDDM_get_verts(result); - + /* using ghash-iterators, map data into new mesh */ /* vertices */ GHASH_ITER (gh_iter, vertHash) { @@ -318,12 +318,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, e_src = medge_src[i_src]; e_dst = medge_dst[i_dst]; - + + DM_copy_edge_data(dm, result, i_src, i_dst, 1); *e_dst = *e_src; e_dst-v1 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src-v1))); e_dst-v2 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src-v2))); - - DM_copy_edge_data(dm, result, i_src, i_dst, 1); } /* faces */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9bd2a7c] master: BGE: Fix T41570: Blender crash when physics createConstraint
Commit: 9bd2a7c0a8fff43d9193184ca6920b4aaed5f6c1 Author: Jorge Bernal Date: Wed Feb 18 19:52:54 2015 +0100 Branches: master https://developer.blender.org/rB9bd2a7c0a8fff43d9193184ca6920b4aaed5f6c1 BGE: Fix T41570: Blender crash when physics createConstraint Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 64bits. Other systems also modified to put them inline with this solution. Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton Reviewed By: juicyfruit, campbellbarton Subscribers: juicyfruit Differential Revision: https://developer.blender.org/D1122 === M source/gameengine/Ketsji/KX_GameObject.cpp M source/gameengine/Ketsji/KX_PyConstraintBinding.cpp === diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 6d4b556..8d22c91 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -36,14 +36,6 @@ # pragma warning( disable:4786 ) #endif -#if defined(_WIN64) !defined(FREE_WINDOWS64) -typedef unsigned __int64 uint_ptr; -#elif defined(FREE_WINDOWS64) -typedef unsigned long long uint_ptr; -#else -typedef unsigned long uint_ptr; -#endif - #include RAS_IPolygonMaterial.h #include KX_BlenderMaterial.h #include KX_GameObject.h @@ -3294,12 +3286,12 @@ PyObject *KX_GameObject::PyGetAxisVect(PyObject *value) PyObject *KX_GameObject::PyGetPhysicsId() { PHY_IPhysicsController* ctrl = GetPhysicsController(); - uint_ptr physid=0; + unsigned long long physid = 0; if (ctrl) { - physid= (uint_ptr)ctrl; + physid = (unsigned long long)ctrl; } - return PyLong_FromLong((long)physid); + return PyLong_FromUnsignedLongLong(physid); } PyObject *KX_GameObject::PyGetPropertyNames() diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 1b69eab..51ae5ca 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -495,11 +495,7 @@ static PyObject *gPyCreateConstraint(PyObject *self, PyObject *kwds) { /* FIXME - physicsid is a long being cast to a pointer, should at least use PyCapsule */ -#if defined(_WIN64) - __int64 physicsid=0,physicsid2 = 0; -#else - long physicsid=0,physicsid2 = 0; -#endif + unsigned long long physicsid = 0, physicsid2 = 0; int constrainttype=0, extrainfo=0; int len = PyTuple_Size(args); int success = 1; @@ -508,51 +504,28 @@ static PyObject *gPyCreateConstraint(PyObject *self, float pivotX=1,pivotY=1,pivotZ=1,axisX=0,axisY=0,axisZ=1; if (len == 3) { -#if defined(_WIN64) - success = PyArg_ParseTuple(args,LLi,physicsid,physicsid2,constrainttype); -#else - success = PyArg_ParseTuple(args,lli,physicsid,physicsid2,constrainttype); -#endif + success = PyArg_ParseTuple(args, KKi, physicsid, physicsid2, constrainttype); } else if (len == 6) { -#if defined(_WIN64) - success = PyArg_ParseTuple(args,LLifff,physicsid,physicsid2,constrainttype, - pivotX,pivotY,pivotZ); -#else - success = PyArg_ParseTuple(args,llifff,physicsid,physicsid2,constrainttype, - pivotX,pivotY,pivotZ); -#endif + success = PyArg_ParseTuple(args, KKifff, physicsid, physicsid2, constrainttype, + pivotX, pivotY, pivotZ); } else if (len == 9) { -#if defined(_WIN64) - success = PyArg_ParseTuple(args,LLiff,physicsid,physicsid2,constrainttype, - pivotX,pivotY,pivotZ,axisX,axisY,axisZ); -#else - success = PyArg_ParseTuple(args,lliff,physicsid,physicsid2,constrainttype, - pivotX,pivotY,pivotZ,axisX,axisY,axisZ); -#endif + success = PyArg_ParseTuple(args, KKiff, physicsid, physicsid2, constrainttype, + pivotX, pivotY, pivotZ, axisX, axisY, axisZ); } else if (len == 10) { -#if defined(_WIN64) - success = PyArg_ParseTuple(args,LLiffi,physicsid,physicsid2,constrainttype, - pivotX,pivotY,pivotZ,axisX,axisY,axisZ,flag); -#else - success = PyArg_ParseTuple(args,lliffi,physicsid,physicsid2,constrainttype, - pivotX,pivotY,pivotZ,axisX,axisY,axisZ,flag); -#endif + success = PyArg_ParseTuple(args, KKiffi, physicsid, physicsid2,
[Bf-blender-cvs] [2d1b512] fracture_modifier: added greasepencil edge fracture, the direction of cutting is currently limited to global X, Y or Z axis
Commit: 2d1b5121df86a69108b23317e8ab73ff5bb1eef3 Author: Martin Felke Date: Wed Feb 18 20:46:15 2015 +0100 Branches: fracture_modifier https://developer.blender.org/rB2d1b5121df86a69108b23317e8ab73ff5bb1eef3 added greasepencil edge fracture, the direction of cutting is currently limited to global X, Y or Z axis === M release/scripts/startup/bl_operators/presets.py M release/scripts/startup/bl_ui/properties_physics_fracture.py M source/blender/blenkernel/BKE_fracture.h M source/blender/blenkernel/intern/fracture.c M source/blender/blenkernel/intern/fracture_util.c M source/blender/editors/object/object_modifier.c M source/blender/makesdna/DNA_modifier_types.h M source/blender/makesrna/intern/rna_modifier.c M source/blender/modifiers/intern/MOD_fracture.c === diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index ff83bf1..b8c8aa7 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -591,7 +591,12 @@ class AddPresetFracture(AddPresetBase, Operator): fracture.execute_threaded, fracture.use_breaking, fracture.nor_range, -fracture.cluster_group +fracture.cluster_group, +fracture.cutter_group, +fracture.grease_offset, +fracture.grease_decimate, +fracture.use_greasepencil_edges, +fracture.cutter_axis, ] preset_subdir = fracture diff --git a/release/scripts/startup/bl_ui/properties_physics_fracture.py b/release/scripts/startup/bl_ui/properties_physics_fracture.py index 25ab354..5e5eb04 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fracture.py +++ b/release/scripts/startup/bl_ui/properties_physics_fracture.py @@ -103,6 +103,11 @@ class PHYSICS_PT_fracture(PhysicButtonsPanel, Panel): box.label(Fracture Point Source:) col = box.column() col.prop(md, point_source) +if 'GREASE_PENCIL' in md.point_source: +col.prop(md, use_greasepencil_edges) +col.prop(md, grease_offset) +col.prop(md, grease_decimate) +col.prop(md, cutter_axis) col.prop(md, extra_group) col.prop(md, dm_group) col.prop(md, use_particle_birth_coordinates) diff --git a/source/blender/blenkernel/BKE_fracture.h b/source/blender/blenkernel/BKE_fracture.h index c513d1e..cc16c7a 100644 --- a/source/blender/blenkernel/BKE_fracture.h +++ b/source/blender/blenkernel/BKE_fracture.h @@ -88,5 +88,6 @@ void BKE_fracture_shard_by_points(struct FracMesh *fmesh, ShardID id, struct Fra /* create shards from a base mesh and a set of other objects / cutter planes */ void BKE_fracture_shard_by_planes(struct FractureModifierData *fmd, struct Object *obj, short inner_material_index, float mat[4][4]); +void BKE_fracture_shard_by_greasepencil(struct FractureModifierData *fmd, struct Object *obj, short inner_material_index, float mat[4][4]); #endif /* BKE_FRACTURE_H */ diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c index 1b0be06..e2fac9b 100644 --- a/source/blender/blenkernel/intern/fracture.c +++ b/source/blender/blenkernel/intern/fracture.c @@ -52,6 +52,7 @@ #include BLI_utildefines.h #include DNA_fracture_types.h +#include DNA_gpencil_types.h #include DNA_group_types.h #include DNA_meshdata_types.h #include DNA_modifier_types.h @@ -59,6 +60,7 @@ #include bmesh.h #include RBI_api.h +//#include GPU_glew.h /* uaahh, direct access to modelview matrix */ /* debug timing */ #define USE_DEBUG_TIMER @@ -394,7 +396,7 @@ static void parse_cells(cell *cells, int expected_shards, ShardID parent_id, Fra DerivedMesh *dm_p = NULL; Shard **tempshards; Shard **tempresults; - int max_retries = 50; + int max_retries = 20; tempshards = MEM_mallocN(sizeof(Shard *) * expected_shards, tempshards); tempresults = MEM_mallocN(sizeof(Shard *) * expected_shards, tempresults); @@ -817,11 +819,292 @@ static void parse_cell_neighbors(cell c, int *neighbors, int totpoly) } } -void BKE_fracture_shard_by_planes(FractureModifierData *fmd, Object *obj, short inner_material_index, float mat[4][4]) +static void stroke_to_faces(FractureModifierData *fmd, Object* ob, BMesh** bm, bGPDstroke *gps, int inner_material_index) +{ + BMVert *lastv = NULL; + BMEdge *laste = NULL; + int p = 0; + float imat[4][4]; + float thresh = (float)fmd-grease_decimate / 100.0f; + float half[3]; + + invert_m4_m4(imat, ob-obmat); + + for (p = 0; p gps-totpoints; p++) { + if ((BLI_frand() thresh) || (p == 0) || (p == gps-totpoints-1)) { +
[Bf-blender-cvs] [3e6aa7b] asset-experiments: Merge branch 'master' into asset-experiments
Commit: 3e6aa7bd0821be80dda748f3340103f899a2c757 Author: Bastien Montagne Date: Wed Feb 18 19:30:06 2015 +0100 Branches: asset-experiments https://developer.blender.org/rB3e6aa7bd0821be80dda748f3340103f899a2c757 Merge branch 'master' into asset-experiments === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a35ced0] asset-experiments: Merge branch 'master' into asset-experiments
Commit: a35ced0b9707684ce6cdb64401e1ec3cfd888f01 Author: Bastien Montagne Date: Tue Feb 17 15:37:20 2015 +0100 Branches: asset-experiments https://developer.blender.org/rBa35ced0b9707684ce6cdb64401e1ec3cfd888f01 Merge branch 'master' into asset-experiments === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4ed8b70] master: BGE: Fix T42437: Physics/Compound bug
Commit: 4ed8b708700af9e80c71e4c82897fbe3cee64e41 Author: Jorge Bernal Date: Wed Feb 18 19:59:21 2015 +0100 Branches: master https://developer.blender.org/rB4ed8b708700af9e80c71e4c82897fbe3cee64e41 BGE: Fix T42437: Physics/Compound bug Null check to verify that parent has a character controller. Otherwise (i.e empty) it will crash. Reviewers: moguri, campbellbarton Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D1115 === M source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp === diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index f450e3a..ac132a5 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -3358,46 +3358,50 @@ void CcdPhysicsEnvironment::ConvertObject(KX_GameObject *gameobj, RAS_MeshObject //take relative transform into account! CcdPhysicsController* parentCtrl = (CcdPhysicsController*)parent-GetPhysicsController(); assert(parentCtrl); - CcdShapeConstructionInfo* parentShapeInfo = parentCtrl-GetShapeInfo(); - btRigidBody* rigidbody = parentCtrl-GetRigidBody(); - btCollisionShape* colShape = rigidbody-getCollisionShape(); - assert(colShape-isCompound()); - btCompoundShape* compoundShape = (btCompoundShape*)colShape; - - // compute the local transform from parent, this may include several node in the chain - SG_Node* gameNode = gameobj-GetSGNode(); - SG_Node* parentNode = parent-GetSGNode(); - // relative transform - MT_Vector3 parentScale = parentNode-GetWorldScaling(); - parentScale[0] = MT_Scalar(1.0)/parentScale[0]; - parentScale[1] = MT_Scalar(1.0)/parentScale[1]; - parentScale[2] = MT_Scalar(1.0)/parentScale[2]; - MT_Vector3 relativeScale = gameNode-GetWorldScaling() * parentScale; - MT_Matrix3x3 parentInvRot = parentNode-GetWorldOrientation().transposed(); - MT_Vector3 relativePos = parentInvRot*((gameNode-GetWorldPosition()-parentNode-GetWorldPosition())*parentScale); - MT_Matrix3x3 relativeRot = parentInvRot*gameNode-GetWorldOrientation(); - - shapeInfo-m_childScale.setValue(relativeScale[0],relativeScale[1],relativeScale[2]); - bm-setLocalScaling(shapeInfo-m_childScale); - shapeInfo-m_childTrans.getOrigin().setValue(relativePos[0],relativePos[1],relativePos[2]); - float rot[12]; - relativeRot.getValue(rot); - shapeInfo-m_childTrans.getBasis().setFromOpenGLSubMatrix(rot); - - parentShapeInfo-AddShape(shapeInfo); - compoundShape-addChildShape(shapeInfo-m_childTrans,bm); - //do some recalc? - //recalc inertia for rigidbody - if (!rigidbody-isStaticOrKinematicObject()) - { - btVector3 localInertia; - float mass = 1.f/rigidbody-getInvMass(); - compoundShape-calculateLocalInertia(mass,localInertia); - rigidbody-setMassProps(mass,localInertia); + + // only makes compound shape if parent has a physics controller (i.e not an empty, etc) + if (parentCtrl) { + CcdShapeConstructionInfo* parentShapeInfo = parentCtrl-GetShapeInfo(); + btRigidBody* rigidbody = parentCtrl-GetRigidBody(); + btCollisionShape* colShape = rigidbody-getCollisionShape(); + assert(colShape-isCompound()); + btCompoundShape* compoundShape = (btCompoundShape*)colShape; + + // compute the local transform from parent, this may include several node in the chain + SG_Node* gameNode = gameobj-GetSGNode(); + SG_Node* parentNode = parent-GetSGNode(); + // relative transform + MT_Vector3 parentScale = parentNode-GetWorldScaling(); + parentScale[0] = MT_Scalar(1.0)/parentScale[0]; + parentScale[1] = MT_Scalar(1.0)/parentScale[1]; +
[Bf-blender-cvs] [86e04c4] master: RNA: assert on over-sized array index access
Commit: 86e04c4ca902e8c9752e708225f262cd0283f8b4 Author: Campbell Barton Date: Thu Feb 19 07:01:49 2015 +1100 Branches: master https://developer.blender.org/rB86e04c4ca902e8c9752e708225f262cd0283f8b4 RNA: assert on over-sized array index access === M source/blender/makesrna/intern/rna_access.c === diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 76c7225..4851474 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1907,6 +1907,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index len); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1970,6 +1971,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index len); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -2020,6 +2022,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index prop-totarraylength); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_default_array(ptr, prop, tmp); @@ -2159,6 +2162,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index len); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -2225,6 +2229,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index len); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -2271,6 +2276,7 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index prop-totarraylength); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_default_array(ptr, prop, tmp); @@ -2426,6 +2432,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index len); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2504,6 +2511,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index len); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2554,6 +2562,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); + BLI_assert(index prop-totarraylength); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_default_array(ptr, prop, tmp); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bbc7dc1] master: RNA: assert when non 0/1 values used as bool
Commit: bbc7dc169dc365889bad3f3aed7b868efb432710 Author: Campbell Barton Date: Thu Feb 19 07:08:10 2015 +1100 Branches: master https://developer.blender.org/rBbbc7dc169dc365889bad3f3aed7b868efb432710 RNA: assert when non 0/1 values used as bool Prepare for using 'bool' type. === M source/blender/makesrna/intern/rna_access.c === diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 4851474..10b5112 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1826,18 +1826,23 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; IDProperty *idprop; + int value; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) == false); if ((idprop = rna_idproperty_check(prop, ptr))) - return IDP_Int(idprop); + value = IDP_Int(idprop); else if (bprop-get) - return bprop-get(ptr); + value = bprop-get(ptr); else if (bprop-get_ex) - return bprop-get_ex(ptr, prop); + value = bprop-get_ex(ptr, prop); else - return bprop-defaultvalue; + value = bprop-defaultvalue; + + BLI_assert(ELEM(value, false, true)); + + return value; } void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) @@ -1847,6 +1852,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) == false); + BLI_assert(ELEM(value, false, true)); /* just in case other values are passed */ if (value) value = 1; @@ -1903,6 +1909,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index { int tmp[RNA_MAX_ARRAY_LENGTH]; int len = rna_ensure_property_array_length(ptr, prop); + int value; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); @@ -1911,18 +1918,20 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); - return tmp[index]; + value = tmp[index]; } else { - int *tmparray, value; + int *tmparray; tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_boolean_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); - - return value; } + + BLI_assert(ELEM(value, false, true)); + + return value; } void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values) @@ -1972,6 +1981,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index = 0); BLI_assert(index len); + BLI_assert(ELEM(value, false, true)); if (len = RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1995,6 +2005,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) == false); + BLI_assert(ELEM(bprop-defaultvalue, false, true)); return bprop-defaultvalue; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9d464a7] master: RNA: use __func__ for alloc-id's
Commit: 9d464a7538f034967b019c8c657ab9e4bbfbdfcc Author: Campbell Barton Date: Thu Feb 19 06:57:45 2015 +1100 Branches: master https://developer.blender.org/rB9d464a7538f034967b019c8c657ab9e4bbfbdfcc RNA: use __func__ for alloc-id's === M source/blender/makesrna/intern/rna_access.c === diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 7a2bd83..76c7225 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1915,7 +1915,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int) * len, RNA_property_boolean_get_index); + tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_boolean_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -1979,7 +1979,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde else { int *tmparray; - tmparray = MEM_callocN(sizeof(int) * len, RNA_property_boolean_get_index); + tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_boolean_get_array(ptr, prop, tmparray); tmparray[index] = value; RNA_property_boolean_set_array(ptr, prop, tmparray); @@ -2028,7 +2028,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int) * len, RNA_property_boolean_get_default_index); + tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_boolean_get_default_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2132,7 +2132,7 @@ void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int va int i; if (array_len 32) { - arr = MEM_mallocN(sizeof(int) * array_len, RNA_property_int_get_array_range); + arr = MEM_mallocN(sizeof(int) * array_len, __func__); } else { arr = arr_stack; @@ -2167,7 +2167,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int) * len, RNA_property_int_get_index); + tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_int_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2234,7 +2234,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i else { int *tmparray; - tmparray = MEM_callocN(sizeof(int) * len, RNA_property_int_get_index); + tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_int_get_array(ptr, prop, tmparray); tmparray[index] = value; RNA_property_int_set_array(ptr, prop, tmparray); @@ -2279,7 +2279,7 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int) * len, RNA_property_int_get_default_index); + tmparray = MEM_callocN(sizeof(int) * len, __func__); RNA_property_int_get_default_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2399,7 +2399,7 @@ void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, floa int i; if (array_len 32) { - arr = MEM_mallocN(sizeof(float) * array_len, RNA_property_float_get_array_range); + arr = MEM_mallocN(sizeof(float) * array_len, __func__); } else { arr = arr_stack; @@ -2434,7 +2434,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index else { float *tmparray, value; - tmparray = MEM_callocN(sizeof(float) * len, RNA_property_float_get_index); + tmparray = MEM_callocN(sizeof(float) * len, __func__); RNA_property_float_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2513,7 +2513,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, else { float
[bd5154b] master: Fix Cycles OpenCL error with scons, util_math_fast.h was missing.ø
Commit: bd5154bb2c642d09b95ff8a2d71e404faa6f6f84 Author: Thomas Dinges Date: Wed Feb 18 22:43:24 2015 +0100 Branches: master https://developer.blender.org/rBbd5154bb2c642d09b95ff8a2d71e404faa6f6f84 Fix Cycles OpenCL error with scons, util_math_fast.h was missing.ø === M build_files/scons/tools/Blender.py === diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index f903668..060904e 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -762,7 +762,7 @@ def AppIt(target=None, source=None, env=None): commands.getoutput(cmd) cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir) commands.getoutput(cmd) -cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir) +cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_math_fast.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir) commands.getoutput(cmd) cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir) commands.getoutput(cmd) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5499474] master: CMake: indent missing header
Commit: 54994740bdfe2aa3b2e7233de9494b3b033183f1 Author: Campbell Barton Date: Thu Feb 19 07:15:55 2015 +1100 Branches: master https://developer.blender.org/rB54994740bdfe2aa3b2e7233de9494b3b033183f1 CMake: indent missing header === M CMakeLists.txt M source/blender/python/intern/CMakeLists.txt === diff --git a/CMakeLists.txt b/CMakeLists.txt index 561d7f1..5b85306 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1255,8 +1255,8 @@ elseif(WIN32) find_package(png) if(NOT PNG_FOUND) - set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include) message(WARNING Using HARDCODED libpng locations) + set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include) set(PNG_LIBRARIES libpng) set(PNG ${LIBDIR}/png) set(PNG_INCLUDE_DIRS ${PNG}/include) @@ -1343,18 +1343,18 @@ elseif(WIN32) set(OPENEXR_VERSION 2.1) find_package(OPENEXR REQUIRED) if(NOT OPENEXR_FOUND) - message(WARNING Using HARDCODED OpenEXR locations) - set(OPENEXR ${LIBDIR}/openexr) - set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include) - set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR) - set(OPENEXR_LIBPATH ${OPENEXR}/lib) - set(OPENEXR_LIBRARIES - ${OPENEXR_LIBPATH}/Iex-2_2.lib - ${OPENEXR_LIBPATH}/Half.lib - ${OPENEXR_LIBPATH}/IlmImf-2_2.lib - ${OPENEXR_LIBPATH}/Imath-2_2.lib - ${OPENEXR_LIBPATH}/IlmThread-2_2.lib - ) + message(WARNING Using HARDCODED OpenEXR locations) + set(OPENEXR ${LIBDIR}/openexr) + set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include) + set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR) + set(OPENEXR_LIBPATH ${OPENEXR}/lib) + set(OPENEXR_LIBRARIES + ${OPENEXR_LIBPATH}/Iex-2_2.lib + ${OPENEXR_LIBPATH}/Half.lib + ${OPENEXR_LIBPATH}/IlmImf-2_2.lib + ${OPENEXR_LIBPATH}/Imath-2_2.lib + ${OPENEXR_LIBPATH}/IlmThread-2_2.lib + ) endif(NOT OPENEXR_FOUND) endif() diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 8f85dbe..8296027 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -47,8 +47,8 @@ set(SRC gpu.c bpy.c bpy_app.c - bpy_app_ffmpeg.c bpy_app_build_options.c + bpy_app_ffmpeg.c bpy_app_handlers.c bpy_app_ocio.c bpy_app_oiio.c @@ -75,11 +75,12 @@ set(SRC gpu.h bpy.h bpy_app.h - bpy_app_ffmpeg.h bpy_app_build_options.h + bpy_app_ffmpeg.h bpy_app_handlers.h bpy_app_ocio.h bpy_app_oiio.h + bpy_app_sdl.h bpy_app_translations.h bpy_driver.h bpy_intern_string.h ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [483fa4c] master: CMake: picky style edit
Commit: 483fa4c38723948a4e9db2c6e93ae762a5ba70de Author: Campbell Barton Date: Thu Feb 19 07:15:00 2015 +1100 Branches: master https://developer.blender.org/rB483fa4c38723948a4e9db2c6e93ae762a5ba70de CMake: picky style edit 'cmake_consistency_check.py' relies on this formattng. === M intern/cycles/util/CMakeLists.txt === diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index bfe46ce..0acb9e9 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -75,8 +75,12 @@ set(SRC_HEADERS ) if(WITH_CYCLES_DEBUG) - list(APPEND SRC util_guarded_allocator.cpp) - list(APPEND SRC_HEADERS util_guarded_allocator.h) + list(APPEND SRC + util_guarded_allocator.cpp + ) + list(APPEND SRC_HEADERS + util_guarded_allocator.h + ) endif() include_directories(${INC}) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f1a9dbb] master: Fix minor mistake - only increase size of compositing when stencil -is- set.
Commit: f1a9dbb0d772d2063ede191c128f59e65ef6b3e4 Author: Antony Riakiotakis Date: Wed Feb 18 22:16:04 2015 +0100 Branches: master https://developer.blender.org/rBf1a9dbb0d772d2063ede191c128f59e65ef6b3e4 Fix minor mistake - only increase size of compositing when stencil -is- set. === M source/blender/gpu/intern/gpu_compositing.c === diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c index 32d8050..89fa1a5 100644 --- a/source/blender/gpu/intern/gpu_compositing.c +++ b/source/blender/gpu/intern/gpu_compositing.c @@ -291,7 +291,7 @@ bool GPU_fx_compositor_initialize_passes( /* scissor is missing when drawing offscreen, in that case, dimensions match exactly. In opposite case * add one to match viewport dimensions */ - if (!scissor_rect) { + if (scissor_rect) { w++, h++; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ee9ac4e] master: CMake: remove expression in endif(...)
Commit: ee9ac4e4fc495ea4a913cfff63650dfe07da35e2 Author: Campbell Barton Date: Thu Feb 19 07:44:40 2015 +1100 Branches: master https://developer.blender.org/rBee9ac4e4fc495ea4a913cfff63650dfe07da35e2 CMake: remove expression in endif(...) === M CMakeLists.txt M build_files/cmake/macros.cmake M source/blender/freestyle/CMakeLists.txt === diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b85306..93e34f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1355,7 +1355,7 @@ elseif(WIN32) ${OPENEXR_LIBPATH}/Imath-2_2.lib ${OPENEXR_LIBPATH}/IlmThread-2_2.lib ) - endif(NOT OPENEXR_FOUND) + endif() endif() if(WITH_IMAGE_TIFF) @@ -1395,10 +1395,10 @@ elseif(WIN32) if(WITH_BOOST) if(WITH_CYCLES_OSL) set(boost_extra_libs wave) - endif(WITH_CYCLES_OSL) + endif() if(WITH_INTERNATIONAL) list(APPEND boost_extra_libs locale) - endif(WITH_INTERNATIONAL) + endif() set(Boost_USE_STATIC_RUNTIME ON) # prefix lib set(Boost_USE_MULTITHREADED ON) # suffix -mt set(Boost_USE_STATIC_LIBS ON) # suffix -s @@ -1525,7 +1525,7 @@ elseif(WIN32) if(WITH_MINGW64) message(STATUS Compiling for 64 bit with MinGW-w64.) execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9) + if(GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9) set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64_gcc49) else() set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64) diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 056241b..5624941 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1103,7 +1103,7 @@ endmacro() macro(blender_project_hack_post) # -- # MINGW HACK END - if (_reset_standard_libraries) + if(_reset_standard_libraries) # Must come after projecINCt(...) # # MINGW workaround for -ladvapi32 being included which surprisingly causes diff --git a/source/blender/freestyle/CMakeLists.txt b/source/blender/freestyle/CMakeLists.txt index 6860afe..7fbb219 100644 --- a/source/blender/freestyle/CMakeLists.txt +++ b/source/blender/freestyle/CMakeLists.txt @@ -577,6 +577,6 @@ if(WIN32) list(APPEND INC_SYS ${PTHREADS_INC} ) -endif(WIN32) +endif() blender_add_lib(bf_freestyle ${SRC} ${INC} ${INC_SYS}) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6c5f63b] master: Guardedalloc: Add extra logging and checks in MEM_freeN()
Commit: 6c5f63b476ccd2ede41b94360641541f0aa9af38 Author: Sergey Sharybin Date: Thu Feb 19 01:58:49 2015 +0500 Branches: master https://developer.blender.org/rB6c5f63b476ccd2ede41b94360641541f0aa9af38 Guardedalloc: Add extra logging and checks in MEM_freeN() We don't like when NULL is send to MEM_freeN(), but there was some differences between lockfree and guarded allocators: - Lockfree would have silently crash, in both release and debug modes - Guarded allocator would have printed error message, abort in debug but keep working in release build. This commit makes lockfree allocator behavior to match guarded one. === M intern/guardedalloc/intern/mallocn.c M intern/guardedalloc/intern/mallocn_guarded_impl.c M intern/guardedalloc/intern/mallocn_lockfree_impl.c === diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index a379837..1fd85a0 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -17,6 +17,7 @@ * * Contributor(s): Brecht Van Lommel * Campbell Barton + * Sergey Sharybin * * * END GPL LICENSE BLOCK * */ diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c index ecc5488..9a50342 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.c +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c @@ -22,6 +22,7 @@ * * Contributor(s): Brecht Van Lommel * Campbell Barton + * Sergey Sharybin * * * END GPL LICENSE BLOCK * */ diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.c b/intern/guardedalloc/intern/mallocn_lockfree_impl.c index eaa6020..b5f3d1b 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c @@ -134,6 +134,14 @@ void MEM_lockfree_freeN(void *vmemh) MemHead *memh = MEMHEAD_FROM_PTR(vmemh); size_t len = MEM_lockfree_allocN_len(vmemh); + if (vmemh == NULL) { + print_error(Attempt to free NULL pointer\n); +#ifdef WITH_ASSERT_ABORT + abort(); +#endif + return; + } + atomic_sub_u(totblock, 1); atomic_sub_z(mem_in_use, len); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b5a14c3] master: Report total unfreed memory size on exit
Commit: b5a14c381cd16aad77ba6aea95e623e83e159d4b Author: Sergey Sharybin Date: Thu Feb 19 02:08:09 2015 +0500 Branches: master https://developer.blender.org/rBb5a14c381cd16aad77ba6aea95e623e83e159d4b Report total unfreed memory size on exit Previously only number of unfreed blocks would have been printed, which might not be totally enough during investigation process. === M source/blender/windowmanager/intern/wm_init_exit.c === diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index cb03d02..9778f16 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -537,7 +537,10 @@ void WM_exit_ext(bContext *C, const bool do_python) BLI_threadapi_exit(); if (MEM_get_memory_blocks_in_use() != 0) { - printf(Error: Not freed memory blocks: %d\n, MEM_get_memory_blocks_in_use()); + size_t mem_in_use = MEM_get_memory_in_use() + MEM_get_memory_in_use(); + printf(Error: Not freed memory blocks: %d, total unfreed memory %f MB\n, + MEM_get_memory_blocks_in_use(), + (double)mem_in_use / 1024 / 1024); MEM_printmemlist(); } wm_autosave_delete(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a759d01] asset-experiments: Big refactor of filelisting in filebrowser - decouple os/fs-related direntry from actual blender listing.
Commit: a759d0190bd12303e9f1f2cf22a3c533d59b9934 Author: Bastien Montagne Date: Wed Feb 18 21:36:48 2015 +0100 Branches: asset-experiments https://developer.blender.org/rBa759d0190bd12303e9f1f2cf22a3c533d59b9934 Big refactor of filelisting in filebrowser - decouple os/fs-related direntry from actual blender listing. Main idea is that direntry had quite a bit of things already absolutely useless in the mere 'file listing' context (image pointer, void 'data' pointer, etc.). On the other end, to handle future asset stuff, we need *more* 'meta data' for our 'files' (tags, variants, revisions...). Further more, we need all this to be easily usable through RNA, i.e. we need it to be defined in DNA. So instead of trying to use direntry in DNA, mixing low-level system stuff like stat where we do not want to see it, we define our own 'file' representation, with only what we really need (who cares about chars or block or dev files in filebrowser? we only need to know whether it's a regular file or a directory, period). That way, low-level dirlisting remains clean, and we can easily extend our own data as needed. Note this new code works, does not crash (so far...) nor memleak, but it needs quite a bit of work still, we are still storing useless stuff in direntry (all those strings representing modes, size etc.!), and mem handling during dir/lib listing is confusing at best (would like to use a memarena or mempool here, but it's not that easy). === M source/blender/blenlib/BLI_fileops.h M source/blender/blenlib/BLI_fileops_types.h M source/blender/blenlib/intern/storage.c M source/blender/editors/interface/interface_icons.c M source/blender/editors/space_file/file_draw.c M source/blender/editors/space_file/file_ops.c M source/blender/editors/space_file/filelist.c M source/blender/editors/space_file/filelist.h M source/blender/editors/space_file/filesel.c M source/blender/editors/space_file/space_file.c M source/blender/makesdna/DNA_space_types.h === diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 7898a54..342498f 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -93,10 +93,10 @@ char *BLI_current_working_dir(char *dir, const size_t maxlen) ATTR_NONNULL(); /* Filelist */ unsigned int BLI_filelist_dir_contents(const char *dir, struct direntry **filelist); -void BLI_filelist_duplicate( -struct direntry **dest_filelist, struct direntry *src_filelist, unsigned int nrentries, -void *(*dup_poin)(void *)); -void BLI_filelist_free(struct direntry *filelist, unsigned int nrentries, void (*free_poin)(void *)); +void BLI_filelist_entry_duplicate(struct direntry *dst, struct direntry *src); +void BLI_filelist_duplicate(struct direntry **dest_filelist, struct direntry *src_filelist, unsigned int nrentries); +void BLI_filelist_entry_free(struct direntry *entry); +void BLI_filelist_free(struct direntry *filelist, unsigned int nrentries); /* Files */ diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h index 0e6eab6..96e39f8 100644 --- a/source/blender/blenlib/BLI_fileops_types.h +++ b/source/blender/blenlib/BLI_fileops_types.h @@ -39,8 +39,6 @@ typedef unsigned int mode_t; #endif -struct ImBuf; - struct direntry { mode_t type; char *relname; @@ -56,7 +54,6 @@ struct direntry { #else struct stat s; #endif - unsigned int flags; charsize[16]; charmode1[4]; charmode2[4]; @@ -64,11 +61,6 @@ struct direntry { charowner[16]; chartime[8]; chardate[16]; - charextra[16]; - void *poin; - int nr; - struct ImBuf *image; - unsigned int selflag; /* selection flag */ }; struct dirlink { diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 46c5a11..31b548d 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -256,7 +256,6 @@ static void bli_builddir(struct BuildDirCtx *dir_ctx, const char *dirname) if (BLI_stat(fullname, file-s) != -1) { file-type = file-s.st_mode; } - file-flags = 0; dir_ctx-nrfiles++; file++; dlink = dlink-next; @@ -411,53 +410,60 @@ unsigned int BLI_filelist_dir_contents(const char *dirname, struct direntry **f } /** + * Deep-duplicate of a single direntry. + * + * \param dup_poin If given, called for each
[Bf-blender-cvs] [0f2adc0] master: Cycles: Make aligned allocation to respect WITH_BLENDER_GUARDEDALLOC
Commit: 0f2adc081716da9f6f09608e762056f3143f91d2 Author: Sergey Sharybin Date: Thu Feb 19 01:48:59 2015 +0500 Branches: master https://developer.blender.org/rB0f2adc081716da9f6f09608e762056f3143f91d2 Cycles: Make aligned allocation to respect WITH_BLENDER_GUARDEDALLOC Title pretty says it all actually. Can only briefly mention that we're indeed entering that state when after applying some WIP patches having much fuller statistics about memory usage would help giving exact memory benefit. === M intern/cycles/util/util_aligned_malloc.cpp === diff --git a/intern/cycles/util/util_aligned_malloc.cpp b/intern/cycles/util/util_aligned_malloc.cpp index 51f21db..3e825ce 100644 --- a/intern/cycles/util/util_aligned_malloc.cpp +++ b/intern/cycles/util/util_aligned_malloc.cpp @@ -15,6 +15,7 @@ */ #include util_aligned_malloc.h +#include util_guarded_allocator.h #include cassert @@ -41,6 +42,9 @@ CCL_NAMESPACE_BEGIN void *util_aligned_malloc(int size, int alignment) { +#ifdef WITH_BLENDER_GUARDEDALLOC + return MEM_mallocN_aligned(size, alignment, Cycles Aligned Alloc); +#endif #ifdef _WIN32 return _aligned_malloc(size, alignment); #elif defined(__APPLE__) @@ -65,7 +69,11 @@ void *util_aligned_malloc(int size, int alignment) void util_aligned_free(void *ptr) { -#ifdef _WIN32 +#if defined(WITH_BLENDER_GUARDEDALLOC) + if(ptr != NULL) { + MEM_freeN(ptr); + } +#elif defined(_WIN32) _aligned_free(ptr); #else free(ptr); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5d06960] master: BGE: Fix T41502 Path following jumping
Commit: 5d0696052a00ca80043852ca891b1bbe0b70ff1b Author: Jorge Bernal Date: Wed Feb 18 23:24:02 2015 +0100 Branches: master https://developer.blender.org/rB5d0696052a00ca80043852ca891b1bbe0b70ff1b BGE: Fix T41502 Path following jumping New Lock Z velocity parameter was added. This parameter avoid the micro-jumping. By default it is actived except when you load an old file that it is deactived to keep former behaviour. Additionally it was solved another issue related with the acceleration: That is the acceleration value was not taked into account and we had always the maximum linear velocity from the beginning of movement. Now the acceleration is taken into account until we reach the maximum velocity. When you load an old file, the acceleration value is set to the maximum range (1000.f). This way we simulate a maximum velocity constant from the beginning of movement (former behaviour). {F142195} Reviewers: moguri, dfelinto, campbellbarton Reviewed By: campbellbarton Subscribers: sergey Differential Revision: https://developer.blender.org/D1074 === 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_SteeringActuator.cpp M source/gameengine/Ketsji/KX_SteeringActuator.h === diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 9159c9e..c902659 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -496,7 +496,7 @@ void init_actuator(bActuator *act) sta-turnspeed = 120.f; sta-dist = 1.f; sta-velocity= 3.f; - sta-flag = ACT_STEERING_AUTOMATICFACING; + sta-flag = ACT_STEERING_AUTOMATICFACING | ACT_STEERING_LOCKZVEL; sta-facingaxis = 1; break; case ACT_MOUSE: diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 1afdc34..f4591e4 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -616,5 +616,17 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + if (!DNA_struct_elem_find(fd-filesdna, bSteeringActuator, float, acceleration)) { + for (ob = main-object.first; ob; ob = ob-id.next) { + bActuator *act; + for (act = ob-actuators.first; act; act = act-next) { + if (act-type == ACT_STEERING) { + bSteeringActuator *sact = act-data; + sact-acceleration = 1000.f; + } + } + } + } } } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 37c6346..7204144 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -2105,12 +2105,15 @@ static void draw_actuator_steering(uiLayout *layout, PointerRNA *ptr) } row = uiLayoutRow(layout, false); - uiItemR(row, ptr, self_terminated, 0, NULL, ICON_NONE); + col = uiLayoutColumn(row, false); + uiItemR(col, ptr, self_terminated, 0, NULL, ICON_NONE); if (RNA_enum_get(ptr, mode)==ACT_STEERING_PATHFOLLOWING) { - uiItemR(row, ptr, update_period, 0, NULL, ICON_NONE); - row = uiLayoutRow(layout, false); + col = uiLayoutColumn(row, false); + uiItemR(col, ptr, update_period, 0, NULL, ICON_NONE); } row = uiLayoutRow(layout, false); + uiItemR(row, ptr, lock_z_velocity, 1, NULL, ICON_NONE); + row = uiLayoutRow(layout, false); uiItemR(row, ptr, show_visualization, 0, NULL, ICON_NONE); if (RNA_enum_get(ptr, mode) != ACT_STEERING_PATHFOLLOWING) { uiLayoutSetActive(row, false); diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index bdf1b62..9af0c1d 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -570,6 +570,7 @@ typedef struct bActuator { #define ACT_STEERING_ENABLEVISUALIZATION 2 #define ACT_STEERING_AUTOMATICFACING 4 #define ACT_STEERING_NORMALUP 8
[Bf-blender-cvs] [bf0a001] master: Cleanup: Remove support for Boost filesystem 2.
Commit: bf0a001e615c85cb998b6f75e0e51188e650 Author: Thomas Dinges Date: Wed Feb 18 13:48:16 2015 +0100 Branches: master https://developer.blender.org/rBbf0a001e615c85cb998b6f75e0e51188e650 Cleanup: Remove support for Boost filesystem 2. This is deprecated since Boost 1.48. === M intern/cycles/util/util_cache.cpp M intern/cycles/util/util_path.cpp === diff --git a/intern/cycles/util/util_cache.cpp b/intern/cycles/util/util_cache.cpp index fbc760f..5eebfb1 100644 --- a/intern/cycles/util/util_cache.cpp +++ b/intern/cycles/util/util_cache.cpp @@ -24,12 +24,6 @@ #include util_path.h #include util_types.h -#include boost/version.hpp - -#if (BOOST_VERSION 104400) -# define BOOST_FILESYSTEM_VERSION 2 -#endif - #include boost/filesystem.hpp #include boost/algorithm/string.hpp diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index a3dbad0..e8f1ec8 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -25,12 +25,6 @@ OIIO_NAMESPACE_USING #include stdio.h -#include boost/version.hpp - -#if (BOOST_VERSION 104400) -# define BOOST_FILESYSTEM_VERSION 2 -#endif - #include boost/filesystem.hpp #include boost/algorithm/string.hpp @@ -101,11 +95,7 @@ string path_user_get(const string sub) string path_filename(const string path) { -#if (BOOST_FILESYSTEM_VERSION == 2) - return to_boost(path).filename(); -#else return from_boost(to_boost(path).filename()); -#endif } string path_dirname(const string path) @@ -284,11 +274,7 @@ void path_cache_clear_except(const string name, const setstring except) boost::filesystem::directory_iterator it(dir), it_end; for(; it != it_end; it++) { -#if (BOOST_FILESYSTEM_VERSION == 2) - string filename = from_boost(it-path().filename()); -#else string filename = from_boost(it-path().filename().string()); -#endif if(boost::starts_with(filename, name)) if(except.find(filename) == except.end()) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0703ba8] GPU_data_request: Move data copying function from gpu_buffers.c to cdderivedmesh.c (as it should be, since it's specialized to this derivedmesh type)
Commit: 0703ba898e8ca1c153c879ad6653e6fca7471ce1 Author: Antony Riakiotakis Date: Wed Feb 18 15:19:31 2015 +0100 Branches: GPU_data_request https://developer.blender.org/rB0703ba898e8ca1c153c879ad6653e6fca7471ce1 Move data copying function from gpu_buffers.c to cdderivedmesh.c (as it should be, since it's specialized to this derivedmesh type) === M source/blender/blenkernel/intern/cdderivedmesh.c M source/blender/gpu/GPU_buffers.h M source/blender/gpu/intern/gpu_buffers.c === diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 2a38418..8224552 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1350,6 +1350,320 @@ static void cdDM_drawMappedEdges(DerivedMesh *dm, DMSetDrawOptions setDrawOption glEnd(); } +static void cdDM_buffer_copy_vertex(DerivedMesh *dm, float *varray, int *index, int *mat_orig_to_new, void *UNUSED(user)) +{ + MVert *mvert; + MFace *f; + int i, j, start, totface; + + mvert = dm-getVertArray(dm); + f = dm-getTessFaceArray(dm); + + totface = dm-getNumTessFaces(dm); + for (i = 0; i totface; i++, f++) { + start = index[mat_orig_to_new[f-mat_nr]]; + + /* v1 v2 v3 */ + copy_v3_v3(varray[start], mvert[f-v1].co); + copy_v3_v3(varray[start + 3], mvert[f-v2].co); + copy_v3_v3(varray[start + 6], mvert[f-v3].co); + index[mat_orig_to_new[f-mat_nr]] += 9; + + if (f-v4) { + /* v3 v4 v1 */ + copy_v3_v3(varray[start + 9], mvert[f-v3].co); + copy_v3_v3(varray[start + 12], mvert[f-v4].co); + copy_v3_v3(varray[start + 15], mvert[f-v1].co); + index[mat_orig_to_new[f-mat_nr]] += 9; + } + } + + /* copy loose points */ + j = dm-drawObject-tot_triangle_point * 3; + for (i = 0; i dm-drawObject-totvert; i++) { + if (dm-drawObject-vert_points[i].point_index = dm-drawObject-tot_triangle_point) { + copy_v3_v3(varray[j], mvert[i].co); + j += 3; + } + } +} + +static void cdDM_buffer_copy_normal(DerivedMesh *dm, float *varray, int *index, int *mat_orig_to_new, void *UNUSED(user)) +{ + int i, totface; + int start; + float f_no[3]; + + const float *nors = dm-getTessFaceDataArray(dm, CD_NORMAL); + short (*tlnors)[4][3] = dm-getTessFaceDataArray(dm, CD_TESSLOOPNORMAL); + MVert *mvert = dm-getVertArray(dm); + MFace *f = dm-getTessFaceArray(dm); + + totface = dm-getNumTessFaces(dm); + for (i = 0; i totface; i++, f++) { + const int smoothnormal = (f-flag ME_SMOOTH); + + start = index[mat_orig_to_new[f-mat_nr]]; + index[mat_orig_to_new[f-mat_nr]] += f-v4 ? 18 : 9; + + if (tlnors) { + short (*tlnor)[3] = tlnors[i]; + /* Copy loop normals */ + normal_short_to_float_v3(varray[start], tlnor[0]); + normal_short_to_float_v3(varray[start + 3], tlnor[1]); + normal_short_to_float_v3(varray[start + 6], tlnor[2]); + + if (f-v4) { + normal_short_to_float_v3(varray[start + 9], tlnor[2]); + normal_short_to_float_v3(varray[start + 12], tlnor[3]); + normal_short_to_float_v3(varray[start + 15], tlnor[0]); + } + } + else if (smoothnormal) { + /* copy vertex normal */ + normal_short_to_float_v3(varray[start], mvert[f-v1].no); + normal_short_to_float_v3(varray[start + 3], mvert[f-v2].no); + normal_short_to_float_v3(varray[start + 6], mvert[f-v3].no); + + if (f-v4) { + normal_short_to_float_v3(varray[start + 9], mvert[f-v3].no); + normal_short_to_float_v3(varray[start + 12], mvert[f-v4].no); + normal_short_to_float_v3(varray[start + 15], mvert[f-v1].no); + } + } + else if (nors) { + /* copy cached face normal */ + copy_v3_v3(varray[start], nors[i * 3]); + copy_v3_v3(varray[start + 3], nors[i * 3]); + copy_v3_v3(varray[start + 6], nors[i * 3]); + + if (f-v4) { + copy_v3_v3(varray[start + 9], nors[i * 3]); +
[Bf-blender-cvs] [49385d8] GPU_data_request: Also move new gpu object to derived mesh - we can probably do a few abstractions here, but gpuObject creation is a bit derivedmesh type specific (each DM h
Commit: 49385d8b1b8afee5c821bac2187030ca59cd7735 Author: Antony Riakiotakis Date: Wed Feb 18 15:35:08 2015 +0100 Branches: GPU_data_request https://developer.blender.org/rB49385d8b1b8afee5c821bac2187030ca59cd7735 Also move new gpu object to derived mesh - we can probably do a few abstractions here, but gpuObject creation is a bit derivedmesh type specific (each DM has its own way to calculate vertices needed etc). === M source/blender/blenkernel/intern/cdderivedmesh.c M source/blender/gpu/intern/gpu_buffers.c === diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 8224552..8a1aea0 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1664,6 +1664,174 @@ static void cdDM_copy_gpu_data(DerivedMesh *dm, int type, float *varray, int *in } } +/* add a new point to the list of points related to a particular + * vertex */ +#ifdef USE_GPU_POINT_LINK + +static void gpu_drawobject_add_vert_point(GPUDrawObject *gdo, int vert_index, int point_index) +{ + GPUVertPointLink *lnk; + + lnk = gdo-vert_points[vert_index]; + + /* if first link is in use, add a new link at the end */ + if (lnk-point_index != -1) { + /* get last link */ + for (; lnk-next; lnk = lnk-next) ; + + /* add a new link from the pool */ + lnk = lnk-next = gdo-vert_points_mem[gdo-vert_points_usage]; + gdo-vert_points_usage++; + } + + lnk-point_index = point_index; +} + +#else + +static void cdDM_drawobject_add_vert_point(GPUDrawObject *gdo, int vert_index, int point_index) +{ + GPUVertPointLink *lnk; + lnk = gdo-vert_points[vert_index]; + if (lnk-point_index == -1) { + lnk-point_index = point_index; + } +} + +#endif /* USE_GPU_POINT_LINK */ + +/* update the vert_points and triangle_to_mface fields with a new + * triangle */ +static void cdDM_drawobject_add_triangle(GPUDrawObject *gdo, +int base_point_index, +int face_index, +int v1, int v2, int v3) +{ + int i, v[3] = {v1, v2, v3}; + for (i = 0; i 3; i++) + cdDM_drawobject_add_vert_point(gdo, v[i], base_point_index + i); + gdo-triangle_to_mface[base_point_index / 3] = face_index; +} + +/* for each vertex, build a list of points related to it; these lists + * are stored in an array sized to the number of vertices */ +static void cdDM_drawobject_init_vert_points(GPUDrawObject *gdo, MFace *f, int totface, int totmat) +{ + GPUBufferMaterial *mat; + int i, *mat_orig_to_new; + + mat_orig_to_new = MEM_callocN(sizeof(*mat_orig_to_new) * totmat, + GPUDrawObject.mat_orig_to_new); + /* allocate the array and space for links */ + gdo-vert_points = MEM_mallocN(sizeof(GPUVertPointLink) * gdo-totvert, + GPUDrawObject.vert_points); +#ifdef USE_GPU_POINT_LINK + gdo-vert_points_mem = MEM_callocN(sizeof(GPUVertPointLink) * gdo-tot_triangle_point, + GPUDrawObject.vert_points_mem); + gdo-vert_points_usage = 0; +#endif + + /* build a map from the original material indices to the new +* GPUBufferMaterial indices */ + for (i = 0; i gdo-totmaterial; i++) + mat_orig_to_new[gdo-materials[i].mat_nr] = i; + + /* -1 indicates the link is not yet used */ + for (i = 0; i gdo-totvert; i++) { +#ifdef USE_GPU_POINT_LINK + gdo-vert_points[i].link = NULL; +#endif + gdo-vert_points[i].point_index = -1; + } + + for (i = 0; i totface; i++, f++) { + mat = gdo-materials[mat_orig_to_new[f-mat_nr]]; + + /* add triangle */ + cdDM_drawobject_add_triangle(gdo, mat-start + mat-totpoint, + i, f-v1, f-v2, f-v3); + mat-totpoint += 3; + + /* add second triangle for quads */ + if (f-v4) { + cdDM_drawobject_add_triangle(gdo, mat-start + mat-totpoint, + i, f-v3, f-v4, f-v1); + mat-totpoint += 3; + } + } + + /* map any unused vertices to loose points */ + for (i = 0; i gdo-totvert; i++) { + if (gdo-vert_points[i].point_index == -1) { + gdo-vert_points[i].point_index = gdo-tot_triangle_point + gdo-tot_loose_point; + gdo-tot_loose_point++; + } + } + + MEM_freeN(mat_orig_to_new); +} + +/*
[Bf-blender-cvs] [6f3500d] master: Cleanup: Remove unused SD_PHASE_HAS_EVAL flag.
Commit: 6f3500db0520b0c3fc70cb175e4e4eb65100 Author: Thomas Dinges Date: Wed Feb 18 16:33:31 2015 +0100 Branches: master https://developer.blender.org/rB6f3500db0520b0c3fc70cb175e4e4eb65100 Cleanup: Remove unused SD_PHASE_HAS_EVAL flag. We only have a non-singular volume closure and therefore no need to distinguish it. === M intern/cycles/kernel/closure/volume.h M intern/cycles/kernel/kernel_types.h === diff --git a/intern/cycles/kernel/closure/volume.h b/intern/cycles/kernel/closure/volume.h index 1cf5e17..4396105 100644 --- a/intern/cycles/kernel/closure/volume.h +++ b/intern/cycles/kernel/closure/volume.h @@ -36,7 +36,7 @@ ccl_device int volume_henyey_greenstein_setup(ShaderClosure *sc) /* clamp anisotropy to avoid delta function */ sc-data0 = signf(sc-data0) * min(fabsf(sc-data0), 1.0f - 1e-3f); - return SD_SCATTER|SD_PHASE_HAS_EVAL; + return SD_SCATTER; } ccl_device float3 volume_henyey_greenstein_eval_phase(const ShaderClosure *sc, const float3 I, float3 omega_in, float *pdf) diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 680094d..238b4b0 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -595,7 +595,6 @@ enum ShaderDataFlag { SD_EMISSION = (1 1), /* have emissive closure? */ SD_BSDF = (1 2), /* have bsdf closure? */ SD_BSDF_HAS_EVAL = (1 3), /* have non-singular bsdf closure? */ - SD_PHASE_HAS_EVAL = (1 3), /* have non-singular phase closure? */ SD_BSSRDF = (1 4), /* have bssrdf */ SD_HOLDOUT= (1 5), /* have holdout closure? */ SD_ABSORPTION = (1 6), /* have volume absorption closure? */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [55fd389] master: New filebrowser bookmarks: Some minor fix/optimization from latest coverity report.
Commit: 55fd389a70b357fa46fd7fcba6f74d8830dd2051 Author: Bastien Montagne Date: Wed Feb 18 13:17:41 2015 +0100 Branches: master https://developer.blender.org/rB55fd389a70b357fa46fd7fcba6f74d8830dd2051 New filebrowser bookmarks: Some minor fix/optimization from latest coverity report. === M source/blender/editors/space_file/file_ops.c === diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 9e7adaa..f8d13bb 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -646,6 +646,10 @@ static int bookmark_move_exec(bContext *C, wmOperator *op) const int act_index = sfile-bookmarknr; int new_index; + if (totitems 2) { + return OPERATOR_CANCELLED; + } + switch (direction) { case FILE_BOOKMARK_MOVE_TOP: new_index = 0; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a2366a3] master: Cleanup for Cycles hair shader ifdefs.
Commit: a2366a3a2e251ac0ddc86284f9d2e9b90b59777e Author: Thomas Dinges Date: Wed Feb 18 15:57:39 2015 +0100 Branches: master https://developer.blender.org/rBa2366a3a2e251ac0ddc86284f9d2e9b90b59777e Cleanup for Cycles hair shader ifdefs. sc-T and sc-data2 were behind __HAIR__ ifdef, now they are not anymore, so we can always assign the correct value. === M intern/cycles/kernel/closure/bsdf_hair.h M intern/cycles/kernel/osl/osl_closures.cpp === diff --git a/intern/cycles/kernel/closure/bsdf_hair.h b/intern/cycles/kernel/closure/bsdf_hair.h index e869312..1e81617 100644 --- a/intern/cycles/kernel/closure/bsdf_hair.h +++ b/intern/cycles/kernel/closure/bsdf_hair.h @@ -54,13 +54,8 @@ ccl_device int bsdf_hair_transmission_setup(ShaderClosure *sc) ccl_device float3 bsdf_hair_reflection_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { -#ifdef __HAIR__ float offset = sc-data2; float3 Tg = sc-T; -#else - float offset = 0.0f; - float3 Tg = make_float3(1.0f, 0.0f, 0.0f); -#endif float roughness1 = sc-data0; float roughness2 = sc-data1; @@ -112,13 +107,8 @@ ccl_device float3 bsdf_hair_reflection_eval_transmit(const ShaderClosure *sc, co ccl_device float3 bsdf_hair_transmission_eval_transmit(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf) { -#ifdef __HAIR__ float offset = sc-data2; float3 Tg = sc-T; -#else - float offset = 0.0f; - float3 Tg = make_float3(1.0f, 0.0f, 0.0f); -#endif float roughness1 = sc-data0; float roughness2 = sc-data1; float Iz = dot(Tg, I); @@ -158,13 +148,8 @@ ccl_device float3 bsdf_hair_transmission_eval_transmit(const ShaderClosure *sc, ccl_device int bsdf_hair_reflection_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { -#ifdef __HAIR__ float offset = sc-data2; float3 Tg = sc-T; -#else - float offset = 0.0f; - float3 Tg = make_float3(1.0f, 0.0f, 0.0f); -#endif float roughness1 = sc-data0; float roughness2 = sc-data1; float Iz = dot(Tg, I); @@ -213,13 +198,8 @@ ccl_device int bsdf_hair_reflection_sample(const ShaderClosure *sc, float3 Ng, f ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf) { -#ifdef __HAIR__ float offset = sc-data2; float3 Tg = sc-T; -#else - float offset = 0.0f; - float3 Tg = make_float3(1.0f, 0.0f, 0.0f); -#endif float roughness1 = sc-data0; float roughness2 = sc-data1; float Iz = dot(Tg, I); diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp index 1d99f1d..461ce8f 100644 --- a/intern/cycles/kernel/osl/osl_closures.cpp +++ b/intern/cycles/kernel/osl/osl_closures.cpp @@ -153,26 +153,16 @@ BSDF_CLOSURE_CLASS_BEGIN(HairReflection, hair_reflection, hair_reflection, LABEL CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.N), CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data0), CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data1), -#ifdef __HAIR__ CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.T), CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data2), -#else - CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.N), - CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data1), -#endif BSDF_CLOSURE_CLASS_END(HairReflection, hair_reflection) BSDF_CLOSURE_CLASS_BEGIN(HairTransmission, hair_transmission, hair_transmission, LABEL_GLOSSY) CLOSURE_FLOAT3_PARAM(HairTransmissionClosure, sc.N), CLOSURE_FLOAT_PARAM(HairTransmissionClosure, sc.data0), CLOSURE_FLOAT_PARAM(HairTransmissionClosure, sc.data1), -#ifdef __HAIR__ CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.T), CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data2), -#else - CLOSURE_FLOAT3_PARAM(HairReflectionClosure, sc.N), - CLOSURE_FLOAT_PARAM(HairReflectionClosure, sc.data1), -#endif BSDF_CLOSURE_CLASS_END(HairTransmission, hair_transmission) VOLUME_CLOSURE_CLASS_BEGIN(VolumeHenyeyGreenstein, henyey_greenstein, LABEL_VOLUME_SCATTER) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [c9fa37f] master: Cycles: Initialize headless flags on engine initialization
Commit: c9fa37fbcd0af7196915fa17642b205024a6d249 Author: Sergey Sharybin Date: Wed Feb 18 21:16:52 2015 +0500 Branches: master https://developer.blender.org/rBc9fa37fbcd0af7196915fa17642b205024a6d249 Cycles: Initialize headless flags on engine initialization This flag is global for all the sessions and never changes. so it doesn't really make sense to pass it around to all sessions and synchronization routines. Switched to a static member of BlenderSession now, but it's probably more logical to introduce some sort of BlenderGlobals. Doesn't currently worth a hassle for a single boolean flag tho. === M intern/cycles/blender/addon/__init__.py M intern/cycles/blender/addon/engine.py M intern/cycles/blender/blender_python.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M intern/cycles/blender/blender_sync.cpp M intern/cycles/blender/blender_sync.h === diff --git a/intern/cycles/blender/addon/__init__.py b/intern/cycles/blender/addon/__init__.py index 8714dfa..64e4a83 100644 --- a/intern/cycles/blender/addon/__init__.py +++ b/intern/cycles/blender/addon/__init__.py @@ -59,7 +59,7 @@ class CyclesRender(bpy.types.RenderEngine): None, None, None, use_osl) else: if not self.session: -engine.create(self, data, scene, headless=bpy.app.background) +engine.create(self, data, scene) else: engine.reset(self, data, scene) diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py index 400cf70..e50a8e4 100644 --- a/intern/cycles/blender/addon/engine.py +++ b/intern/cycles/blender/addon/engine.py @@ -25,10 +25,10 @@ def init(): path = os.path.dirname(__file__) user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', ''))) -_cycles.init(path, user_path) +_cycles.init(path, user_path, bpy.app.background) -def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False, headless=False): +def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False): import bpy import _cycles @@ -42,7 +42,7 @@ def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=Fa if rv3d: rv3d = rv3d.as_pointer() -engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl, headless) +engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl) def free(engine): diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 78419f7..292af14 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -73,8 +73,9 @@ static const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce) static PyObject *init_func(PyObject *self, PyObject *args) { PyObject *path, *user_path; + int headless; - if(!PyArg_ParseTuple(args, OO, path, user_path)) { + if(!PyArg_ParseTuple(args, OOi, path, user_path, headless)) { return NULL; } @@ -84,16 +85,18 @@ static PyObject *init_func(PyObject *self, PyObject *args) Py_XDECREF(path_coerce); Py_XDECREF(user_path_coerce); + BlenderSession::headless = headless; + Py_RETURN_NONE; } static PyObject *create_func(PyObject *self, PyObject *args) { PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d; - int preview_osl, headless; + int preview_osl; - if(!PyArg_ParseTuple(args, OOOii, pyengine, pyuserpref, pydata, pyscene, -pyregion, pyv3d, pyrv3d, preview_osl, headless)) + if(!PyArg_ParseTuple(args, OOOi, pyengine, pyuserpref, pydata, pyscene, +pyregion, pyv3d, pyrv3d, preview_osl)) { return NULL; } @@ -147,7 +150,7 @@ static PyObject *create_func(PyObject *self, PyObject *args) } /* offline session or preview render */ - session = new BlenderSession(engine, userpref, data, scene, headless); + session = new BlenderSession(engine, userpref, data, scene); } python_thread_state_save(session-python_thread_state); diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 466a39e..e61203d 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -41,8 +41,10 @@ CCL_NAMESPACE_BEGIN +bool BlenderSession::headless = false; + BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::UserPreferences b_userpref_, -
[Bf-blender-cvs] [f0527d9] master: Ghost/X11 cleanup (reduce variable scope)
Commit: f0527d963180e7f88cd8f89dde82512a38382abc Author: Campbell Barton Date: Thu Feb 19 09:02:36 2015 +1100 Branches: master https://developer.blender.org/rBf0527d963180e7f88cd8f89dde82512a38382abc Ghost/X11 cleanup (reduce variable scope) === M intern/ghost/intern/GHOST_WindowX11.cpp === diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index bd64cd2..f4b9b84 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -306,8 +306,6 @@ GHOST_WindowX11( exit(EXIT_FAILURE); } - int natom; - unsigned int xattributes_valuemask = 0; XSetWindowAttributes xattributes; @@ -354,7 +352,6 @@ GHOST_WindowX11( xattributes); } else { - Window root_return; int x_return, y_return; unsigned int w_return, h_return, border_w_return, depth_return; @@ -429,36 +426,43 @@ GHOST_WindowX11( m_post_state = GHOST_kWindowStateNormal; } + /* Create some hints for the window manager on how * we want this window treated. */ + { + XSizeHints *xsizehints = XAllocSizeHints(); + xsizehints-flags = PPosition | PSize | PMinSize | PMaxSize; + xsizehints-x = left; + xsizehints-y = top; + xsizehints-width = width; + xsizehints-height = height; + xsizehints-min_width = 320; /* size hints, could be made apart of the ghost api */ + xsizehints-min_height = 240;/* limits are also arbitrary, but should not allow 1x1 window */ + xsizehints-max_width = 65535; + xsizehints-max_height = 65535; + XSetWMNormalHints(m_display, m_window, xsizehints); + XFree(xsizehints); + } + + + /* XClassHint, title */ + { + XClassHint *xclasshint = XAllocClassHint(); + const int len = title.Length() + 1; + char *wmclass = (char *)malloc(sizeof(char) * len); + memcpy(wmclass, title.ReadPtr(), len * sizeof(char)); + xclasshint-res_name = wmclass; + xclasshint-res_class = wmclass; + XSetClassHint(m_display, m_window, xclasshint); + free(wmclass); + XFree(xclasshint); + } - XSizeHints *xsizehints = XAllocSizeHints(); - xsizehints-flags = PPosition | PSize | PMinSize | PMaxSize; - xsizehints-x = left; - xsizehints-y = top; - xsizehints-width = width; - xsizehints-height = height; - xsizehints-min_width = 320; /* size hints, could be made apart of the ghost api */ - xsizehints-min_height = 240;/* limits are also arbitrary, but should not allow 1x1 window */ - xsizehints-max_width = 65535; - xsizehints-max_height = 65535; - XSetWMNormalHints(m_display, m_window, xsizehints); - XFree(xsizehints); - - XClassHint *xclasshint = XAllocClassHint(); - const int len = title.Length() + 1; - char *wmclass = (char *)malloc(sizeof(char) * len); - strncpy(wmclass, (const char *)title, sizeof(char) * len); - xclasshint-res_name = wmclass; - xclasshint-res_class = wmclass; - XSetClassHint(m_display, m_window, xclasshint); - free(wmclass); - XFree(xclasshint); /* The basic for a good ICCCM work */ if (m_system-m_atom.WM_PROTOCOLS) { Atom atoms[2]; - natom = 0; + int natom = 0; if (m_system-m_atom.WM_DELETE_WINDOW) { atoms[natom] = m_system-m_atom.WM_DELETE_WINDOW; @@ -480,21 +484,25 @@ GHOST_WindowX11( m_xic = NULL; #endif + /* Set the window hints */ - XWMHints *xwmhints = XAllocWMHints(); - xwmhints-initial_state = NormalState; - xwmhints-input = True; - xwmhints-flags = InputHint | StateHint; - XSetWMHints(display, m_window, xwmhints); - XFree(xwmhints); - /* done setting the hints */ + { + XWMHints *xwmhints = XAllocWMHints(); + xwmhints-initial_state = NormalState; + xwmhints-input = True; + xwmhints-flags = InputHint | StateHint; + XSetWMHints(display, m_window, xwmhints); + XFree(xwmhints); + } + /* set the icon */ - Atom _NET_WM_ICON = XInternAtom(m_display, _NET_WM_ICON, False); - XChangeProperty(m_display, m_window, _NET_WM_ICON, XA_CARDINAL, - 32, PropModeReplace, (unsigned char *)BLENDER_ICON_48x48x32, - BLENDER_ICON_48x48x32[0] * BLENDER_ICON_48x48x32[1] + 2); - /* done setting the
[Bf-blender-cvs] [5ed2cc8] master: Fix T43652: X11 _NET_WM_PID not set by Ghost
Commit: 5ed2cc80708b5a9b5c5185ffb50b9d214ba5d0a2 Author: Campbell Barton Date: Thu Feb 19 09:19:12 2015 +1100 Branches: master https://developer.blender.org/rB5ed2cc80708b5a9b5c5185ffb50b9d214ba5d0a2 Fix T43652: X11 _NET_WM_PID not set by Ghost D1107 by @kevindietrich === M intern/ghost/intern/GHOST_WindowX11.cpp === diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index f4b9b84..613b4df 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -56,6 +56,9 @@ #include cstring #include cstdio +/* gethostname */ +#include unistd.h + #include algorithm #include string @@ -71,6 +74,9 @@ typedef struct { #define MWM_HINTS_DECORATIONS (1L 1) +#ifndef HOST_NAME_MAX +# define HOST_NAME_MAX 64 +#endif // #define GHOST_X11_GRAB @@ -504,6 +510,30 @@ GHOST_WindowX11( BLENDER_ICON_48x48x32[0] * BLENDER_ICON_48x48x32[1] + 2); } + /* set the process ID (_NET_WM_PID) */ + { + Atom _NET_WM_PID = XInternAtom(m_display, _NET_WM_PID, False); + pid_t pid = getpid(); + XChangeProperty(m_display, m_window, _NET_WM_PID, XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)pid, 1); + } + + + /* set the hostname (WM_CLIENT_MACHINE) */ + { + char hostname[HOST_NAME_MAX]; + char *text_array[1]; + XTextProperty text_prop; + + gethostname(hostname, sizeof(hostname)); + hostname[sizeof(hostname) - 1] = '\0'; + text_array[0] = hostname; + + XStringListToTextProperty(text_array, 1, text_prop); + XSetWMClientMachine(m_display, m_window, text_prop); + XFree(text_prop.value); + } + #ifdef WITH_X11_XINPUT initXInputDevices(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a74bd1b] master: Generate correct Cycles node setup for quick smoke fire preset.
Commit: a74bd1bec743ab35418f9b23fa5dce545cd14930 Author: Thomas Dinges Date: Thu Feb 19 00:17:21 2015 +0100 Branches: master https://developer.blender.org/rBa74bd1bec743ab35418f9b23fa5dce545cd14930 Generate correct Cycles node setup for quick smoke fire preset. Patch by Gottfried Hofmann. Differential Revision: https://developer.blender.org/D1103 === M release/scripts/startup/bl_operators/object_quick_effects.py === diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 495b671..24e471e 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -388,7 +388,7 @@ class QuickSmoke(Operator): links.new(node_add_shader_1.outputs[Shader], node_out.inputs[Volume]) -if self.style in {'SMOKE', 'BOTH'}: +if self.style in {'SMOKE', 'FIRE', 'BOTH'}: # Smoke # Add shader 2 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5721863] master: RNA: pass only 0/1 to RNA_property_boolean_set
Commit: 57218638052c72d1e25f3201c8356d11bd690834 Author: Campbell Barton Date: Thu Feb 19 12:33:14 2015 +1100 Branches: master https://developer.blender.org/rB57218638052c72d1e25f3201c8356d11bd690834 RNA: pass only 0/1 to RNA_property_boolean_set === M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/physics/rigidbody_world.c M source/blender/editors/space_clip/clip_ops.c M source/blender/editors/space_file/filesel.c M source/blender/editors/transform/transform_generics.c === diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 41caa77..38a7ffa 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1642,7 +1642,7 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event) mousef[1] = p-mval[1]; RNA_float_set_array(itemptr, mouse, mousef); RNA_float_set(itemptr, pressure, p-pressure); - RNA_boolean_set(itemptr, is_start, (p-flags GP_PAINTFLAG_FIRSTRUN)); + RNA_boolean_set(itemptr, is_start, (p-flags GP_PAINTFLAG_FIRSTRUN) != 0); RNA_float_set(itemptr, time, p-curtime - p-inittime); diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 1ce5068..97cb45d 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -1214,7 +1214,7 @@ static void bake_set_props(wmOperator *op, Scene *scene) prop = RNA_struct_find_property(op-ptr, use_selected_to_active); if (!RNA_property_is_set(op-ptr, prop)) { - RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_TO_ACTIVE)); + RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_TO_ACTIVE) != 0); } prop = RNA_struct_find_property(op-ptr, cage_extrusion); @@ -1254,22 +1254,22 @@ static void bake_set_props(wmOperator *op, Scene *scene) prop = RNA_struct_find_property(op-ptr, use_clear); if (!RNA_property_is_set(op-ptr, prop)) { - RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_CLEAR)); + RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_CLEAR) != 0); } prop = RNA_struct_find_property(op-ptr, use_cage); if (!RNA_property_is_set(op-ptr, prop)) { - RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_CAGE)); + RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_CAGE) != 0); } prop = RNA_struct_find_property(op-ptr, use_split_materials); if (!RNA_property_is_set(op-ptr, prop)) { - RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_SPLIT_MAT)); + RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_SPLIT_MAT) != 0); } prop = RNA_struct_find_property(op-ptr, use_automatic_name); if (!RNA_property_is_set(op-ptr, prop)) { - RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_AUTO_NAME)); + RNA_property_boolean_set(op-ptr, prop, (bake-flag R_BAKE_AUTO_NAME) != 0); } } diff --git a/source/blender/editors/physics/rigidbody_world.c b/source/blender/editors/physics/rigidbody_world.c index 7bb189b..f7a2c83 100644 --- a/source/blender/editors/physics/rigidbody_world.c +++ b/source/blender/editors/physics/rigidbody_world.c @@ -167,7 +167,7 @@ static int rigidbody_world_export_exec(bContext *C, wmOperator *op) static int rigidbody_world_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (!RNA_struct_property_is_set(op-ptr, relative_path)) - RNA_boolean_set(op-ptr, relative_path, (U.flag USER_RELPATHS)); + RNA_boolean_set(op-ptr, relative_path, (U.flag USER_RELPATHS) != 0); if (RNA_struct_property_is_set(op-ptr, filepath)) return rigidbody_world_export_exec(C, op); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index b99b23c..322825c 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -274,7 +274,7 @@ static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event) return open_exec(C, op); if (!RNA_struct_property_is_set(op-ptr, relative_path)) - RNA_boolean_set(op-ptr, relative_path, U.flag USER_RELPATHS); + RNA_boolean_set(op-ptr, relative_path, (U.flag USER_RELPATHS) != 0); open_init(C, op); diff --git a/source/blender/editors/space_file/filesel.c
[Bf-blender-cvs] [eee7964] master: RNA: poll functions restricting object types
Commit: eee79641c362c974c40cbd289cf14685c6b86f92 Author: Campbell Barton Date: Thu Feb 19 10:02:51 2015 +1100 Branches: master https://developer.blender.org/rBeee79641c362c974c40cbd289cf14685c6b86f92 RNA: poll functions restricting object types D1100,D1105,D1106 by @lichtwerk === M source/blender/makesrna/intern/rna_constraint.c M source/blender/makesrna/intern/rna_modifier.c === diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index b6845b1..aaacf07 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2286,6 +2286,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) /* target chain */ prop = RNA_def_property(srna, target, PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, tar); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, rna_Curve_object_poll); RNA_def_property_ui_text(prop, Target, Curve that controls this relationship); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, rna_Constraint_dependency_update); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 75a1def..656c19e 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2276,7 +2276,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) prop = RNA_def_property(srna, object, PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, Object, Mesh object to deform with); - RNA_def_property_pointer_funcs(prop, NULL, rna_MeshDeformModifier_object_set, NULL, NULL); + RNA_def_property_pointer_funcs(prop, NULL, rna_MeshDeformModifier_object_set, NULL, rna_Mesh_object_poll); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, rna_Modifier_dependency_update); @@ -2352,6 +2352,7 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) prop = RNA_def_property(srna, object, PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, ob); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, rna_Mesh_object_poll); RNA_def_property_ui_text(prop, Object, Object that has the particle system); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, rna_Modifier_dependency_update); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs