Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-03-14Merge branch 'master' into blender2.8Campbell Barton
2017-03-14Fix own mistake in recent 'edge split' refactor.Bastien Montagne
We do can have some vertices to split, while not having any edge (think about two cones sharing the same tip vertex e.g.).
2017-03-02Merge branch 'master' into blender2.8Julian Eisel
Conflicts: source/blender/blenkernel/intern/scene.c
2017-03-02Fix own stupid mistake in recent mesh 'split_faces' rework.Bastien Montagne
Was assigning new edge index to ml_prev->e, and then assigning ml_pre->e to orig_index...
2017-02-23Merge branch 'master' into blender2.8Bastien Montagne
2017-02-22Cycles: Fix shading with autosmooth and custom normalsSergey Sharybin
New logic of split_faces was leaving mesh in a proper state from Blender's point of view, but Cycles wanted loop normals to be "flushed" to vertex normals. Now we do such a flush from Cycles side again, so we don't leave bad meshes behind. Thanks Bastien for assistance here!
2017-02-22Refactor Mesh split_faces() code to use loop normal spaces.Bastien Montagne
Finding which loop should share its vertex with which others is not easy with regular Mesh data (mostly due to lack of advanced topology info, as opposed with BMesh case). Custom loop normals computing already does that - and can return 'loop normal spaces', which among other things contain definitions of 'smooth fans' of loops around vertices. Using those makes it easy to find vertices (and then edges) that needs splitting. This commit also adds support of non-autosmooth meshes, where we want to split out flat faces from smooth ones.
2017-02-20Fix T50718: Regression: Split Normals Render Problem with CyclesSergey Sharybin
The issue seems to be caused by vertex normal being re-calculated to something else than loop normal, which also caused wrong loop normals after re-calculation. For now issue is solved by preserving CD_NORMAL for loops after split_faces() is finished, so render engine can access original proper value.
2017-02-20Mesh faces split: Add missing vertex normal copySergey Sharybin
2017-02-17Merge branch 'master' into blender2.8Bastien Montagne
Conflicts: source/blender/editors/animation/anim_draw.c
2017-02-16Faces split: Don't leave CD_NORMAL after splitSergey Sharybin
This is supposed to be a temporary layer. If someone needs loop normals after split it should explicitly ask for that.
2017-02-16Fix more corner cases failing in mesh faces splitSergey Sharybin
Now we handle properly case with edge-fan meshes, which should fix bad topology calculated for cash register which was causing crashes in the studio.
2017-02-15Fix wrong edges created by split facesSergey Sharybin
We need to first split all vertices before we can reliably check whether edge can be reused or not. There is still known issue happening with a edge-fan mesh with some faces being on the same plane.
2017-02-15Fix T50662: Auto-split affects on smooth mesh when it sohuldn'tSergey Sharybin
Seems to be a precision error comparing proper floating point normal with the one coming from short.
2017-02-15Fix wrong loop normals left after face splittingSergey Sharybin
Let's keep all data in a consistent state, so we don't have any issues later on. This solves rendering artifacts mentioned in the previous commit.
2017-02-15Mesh: Re-implement face split solving issue mentioned earlierSergey Sharybin
Now new edges will be properly created between original and new split vertices. Now topology is correct, but shading is still not quite in some special cases.
2017-02-15Revert "Mesh: Solve incorrect result of mesh.split_faces()"Sergey Sharybin
The change was delivering broken topology for certain cases. The assumption that new edge only connects new vertices was wrong. Reverting to a commit which was giving correct render results but was using more memory. This reverts commit af1e48e8ab7a25269ba5a44158bd16c564ed3535.
2017-02-14Mesh: Solve incorrect result of mesh.split_faces()Sergey Sharybin
This function was keeping original edges and was creating some extra vertices which is not something we are really looking forward to,
2017-02-14Mesh: Cleanup, use shorter version of loopSergey Sharybin
2017-02-14Mesh: Use faster calculation of previous loopSergey Sharybin
2017-01-25Convert MBC_ API to Mesh (instead of derived mesh) and move it to mesh_renderDalai Felinto
This includes a few fixes in the MBC_ api. The idea here is for this to be the only interface the render engines will deal with for the meshes. If we need to expose special options for sculpting engine we refactor this accordingly. But for now we are shaping this in a per-case base. Note: * We still need to hook up to the depsgraph to force clear/update of batch_cache when mesh changes (I'm waiting for Sergey Sharybin's depsgraph update for this though) * Also ideally we could/should use BMesh directly instead of DerivedMesh, but this will do for now. Note 2: In the end I renamed the `BKE_mesh_render` functions to `static mesh_render`. We can re-expose them as BKE_* later once we need it. Reviewers: merwin Subscribers: fclem Differential Revision: https://developer.blender.org/D2476
2017-01-11Copy autosmooth mesh settings BKE_mesh_new_from_objectSergey Sharybin
This way render engine can first apply all modifiers on the new mesh and then optionally perform autosmooth face splitting on it.
2016-10-24Fix mistake in BKE_mesh_new_from_object handling of materials in MetaBall case.Bastien Montagne
Typo, spoted by Coverity scan. To be backported to 2.78a.
2016-10-11Fix T49623: Immediately crash trying to render attached file in CyclesSergey Sharybin
Original fix in this area was not really complete (but was the safest at the release time). Now all the crazy configurations of slots going out of sync should be handled here.
2016-10-03Fix T49548: Entering Cycles Rendered Viewport Unlinks Material from Objects.Bastien Montagne
We *always* want to increase mat user count when from Object (and not Data), because in that case we are moving mat from object to temp generated mesh, material can never be 'borrowed' in that case. To be backported to 2.78a
2016-09-23Cycles: Prevent crash in special cases when object has less slots than meshSergey Sharybin
This is something what was guaranteed in give_current_material(), just copied some range checking logic from there. Not sure what would be a proper fix here tho.
2016-09-09Cleanup: IndentationSergey Sharybin
2016-08-30Fix stupid mistake in previous commit 'cleanup' part.Bastien Montagne
Thanks to sergey for spotting it.
2016-08-30Fix bad usercount handling of materials in BKE_mesh_new_from_object().Bastien Montagne
Curves and meshes (when no modifier application required) would increase their material usercount twice. Not sure how/why it worked in previous code, but with new, stricter ID handling we need more careful check of ID 'ownership' handling. Reported by Sergey over IRC, thanks.
2016-07-25Cleanup: factorize the 'ensure local' part of datablock copy into a single ↵Bastien Montagne
BKE_id_copy_ensure_local function.
2016-07-21Refactor/deduplicate even more make_local code (and fix part of T48907).Bastien Montagne
Turns out most BKE_foo_make_local datablock-specific functions are actually doing exactly the same thing, only two currently need special additional operations (object and brush ones). So added a BKE_id_make_local_generic instead of copying same code over and over. Also, changed a bit how make_local works in case we are localizing a whole library. We need to do the 'remap' step (from old linked ID to new local one) in the second loop, otherwise we miss some dependencies. This fixes main part of T48907.
2016-07-20Cleanup: remove completely call to test_object_materials in ↵Bastien Montagne
BKE_mesh_new_from_object. Don't know why this was ever added to start with, BKE_mesh_new_from_object shall never affect ob->data!
2016-07-20Fix T48898: shaders are removed from metaballs on cycles render.Bastien Montagne
Note that issue has several levels here actually, first one was metaball's materials not being properly copied into new mesh (code was commented out because of some crash it seems, made it a bit closer to mesh one and got no crash at all...). Then, we were calling test_object_materials when ob->data is actually *not* new tmpmesh! Will remove this call completely in next commit (to make it easier to bisect), I cannot see any case where object would be assigned with newly generated tmpmesh in this func.
2016-07-16Fix use after free error from ab993e37Campbell Barton
2016-07-14Cleanup/refactor: handle shapekeys exactly like 'owned' nodetrees in ↵Bastien Montagne
make_local process.
2016-07-14Get rid of BKE_key_make_local().Bastien Montagne
This function was only a wrapper around id_clear_lib_data(), and shapekeys are not linkable nor shareable anyway, no point keeping this currently, was only adding confusion about shapekey 'status' as a datatblock.
2016-07-14Add option to id_make_local to force localization of datablock, even if not ↵Bastien Montagne
used locally. Will be used by link/append code.
2016-07-11Remove usercount handling from BKE_id_expand_local.Bastien Montagne
Idea looked good, but we have too much custom situations here (some half-fake-sub-ID being copied with their 'owner', animdata, etc.), let's let datablock copy functions handle that themselves. Also allows to safely call BKE_id_expand_local from all copy functions now (only when copying linked data).
2016-07-11Cleanup: remove call to BKE_id_lib_local_paths() in make_local functions.Bastien Montagne
This one is already called by matching copy functions, no need to call it twice!
2016-07-11Use new generic BKE_id_expand_local() for both make_local() and copy() ↵Bastien Montagne
functions of obdata (armature, mesh, curve, mball, lattice, lamp, camera, and speaker). This greatly simplifies said code, once again no change expected from user PoV.
2016-07-10Cleanup/Refactor: pass Main pointer to all ID copy functions.Bastien Montagne
Also allows us to get rid of a few _copy_ex() versions...
2016-07-09Add BKE_key_copy_ex() that takes a Main as parameter.Bastien Montagne
2016-07-09Refactor/enhance BKE_curve_make_local(), and add BKE_curve_copy_ex() that ↵Bastien Montagne
takes a Main as parameter. Now using modern features from libquery/libremap areas. Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-09Cleanup to shapekeys' make_local (and copy) functions.Bastien Montagne
Mostly pass bmain and do not check for NULL key, keys' make_local is suspiciously simple in fact, but think until those behave like real full-featured IDs, it's doing enough!
2016-07-08Fix (unreported) broken shapekeys after 'make_local' of datablocks used both ↵Bastien Montagne
directly and directly. At first thought it was own recent work, but think issue is there since ages actually... Basically, id_make_local() would always localize mesh/curve/lattice shapekeys, even in case obdata localization actually made a local copy instead of localizing original datablock. This was causing shapekeys being localized twice, and other odd nasty effects.
2016-07-08Refactor/enhance BKE_mesh_make_local().Bastien Montagne
Now using modern features from libquery/libremap areas. Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6). Note: this enlightened broken case of proxy objects regarding make_local (and also whole remapping, in fact). Will be fixed in near future.
2016-07-08Rework/split test_object_materials().Bastien Montagne
Now test_object_materials only handles one object. New test_all_objects_materials checks the whole bmain->object list for cases where it is actually needed. Should avoid some useless looping over all objects!
2016-07-06Replace of (id->lib != NULL) check by meaningful macro.Bastien Montagne
Idea is to replace hard-to-track (id->lib != NULL) 'is linked datablock' check everywhere in Blender by a macro doing the same thing. This will allow to easily spot those checks in future, and more importantly, to easily change it (see work done in asset-engine branch). Note: did not touch to readfile.c, since there most of the time 'id->lib' check actually concerns the pointer, and not a check whether ID is linked or not. Will have a closer look at it later. Reviewers: campbellbarton, brecht, sergey Differential Revision: https://developer.blender.org/D2082
2016-07-01BMesh: make toolflags optionalCampbell Barton
Saves 8 bytes per vert/edge/face. Gives overall ~20-25% memory saving for dyntopo sculpting and modifiers that use BMesh.
2016-06-25Cleanup: Get rid of remaining 'BKE_<id>_unlink()' functions, no more used ↵Bastien Montagne
anyway.