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
2018-12-12Cleanup: use colon separator after parameterCampbell Barton
Helps separate variable names from descriptive text. Was already used in some parts of the code, double space and dashes were used elsewhere.
2018-09-24Spelling fixes in comments and descriptions, patch by luzpaz.Brecht Van Lommel
Differential Revision: https://developer.blender.org/D3719
2018-09-19BLI_utildefines: rename pointer conversion macrosCampbell Barton
Terms get/set don't make much sense when casting values. Name macros so the conversion is obvious, use common prefix for easier completion. - GET_INT_FROM_POINTER -> POINTER_AS_INT - SET_INT_IN_POINTER -> POINTER_FROM_INT - GET_UINT_FROM_POINTER -> POINTER_AS_UINT - SET_UINT_IN_POINTER -> POINTER_FROM_UINT
2018-07-13Cleanup: right shift argumentsCampbell Barton
2018-06-17Cleanup: trailing space for blenkernelCampbell Barton
2018-05-29Cleanup: Get rid of G.main in BKE_material.Bastien Montagne
Note that in some cases, this only moves the G.main case to somne other places - in particular, RNA getters/setters are becoming annoying here...
2018-05-08Cleanup: includesCampbell Barton
2018-05-08Cleanup: move mesh conversion into own functionCampbell Barton
2018-04-19Cleanup: rename vlak -> polyCampbell Barton
2018-04-04Fix modifier freeing code re. ID refcounting.Bastien Montagne
Free code should not handle ID refcounting at all. This has to be done at higher level, since in some case we want to free (temp) data that actually did not refcount at all its IDs. This change seems to be working OK, but as usual in that area, only lots of testing in real-case situation will say whether there are some hidden bugs or not.
2018-03-16Depsgraph: Move evaluation debug prints to depsgraphSergey Sharybin
This way we can easily control format and keep it consistent. And also possibly do other trickery, like coloring addresses!
2018-03-02Fix building w/o PythonCampbell Barton
Also minor cleanup.
2018-03-01Refactor: Merge non-functional-change part of 'edit normals' 2017 GSoC.Bastien Montagne
This merges changes in internals, runtime-only of existing custom normals code, which make sense as of themselves, and will make diff of soc branch easier/lighter to review. In the details, it mostly changes two things: * Now, smooth fans (aka MLoopNorSpaceArray) can store either loop indices, or pointers to BMLoop themselves. This makes sense since in BMesh, it's relatively easy to get index from a BMElement, but nearly impracticable to go the other way around. * First change enforces another, now we cannot rely anymore on `loops` being NULL in MLoopNorSpace to detect single-loop fans, so we instead store that info in a new flag. Again, these are expected to be totally non-functional changes.
2018-02-21Depsgraph: Split debug flagsSergey Sharybin
Now it's possible to have debug messages for following things: - Graph construction - Graph evaluation - Graph tagging
2018-02-15Cleanup: use '_len' instead of '_size' w/ BLI APICampbell Barton
- When returning the number of items in a collection use BLI_*_len() - Keep _size() for size in bytes. - Keep _count() for data structures that don't store length (hint this isn't a simple getter). See P611 to apply instead of manually resolving conflicts.
2018-01-18Fix buffer overflow vulnerabilities in mesh code.Brecht Van Lommel
Solves these security issues from T52924: CVE-2017-12081 CVE-2017-12082 CVE-2017-12086 CVE-2017-12099 CVE-2017-12100 CVE-2017-12101 CVE-2017-12105 While the specific overflow issue may be fixed, loading the repro .blend files may still crash because they are incomplete and corrupt. The way they crash may be impossible to exploit, but this is difficult to prove. Differential Revision: https://developer.blender.org/D3002
2017-12-19Fix T53559: Auto texture space for text and font is wrong in CyclesSergey Sharybin
The issue actually goes a bit deeper, converting curve to mesh will change texture space just because font and bezier curves are using CV to calculate texture space. So now when those objects are converted to mesh, we disable auto texture space and copy evaluated space over.
2017-09-04Fix T52649: missing custom (split) normals from FBX exporter.Bastien Montagne
Own mistake in recent rB25c5928b2b6 (this DOES NOT affect 2.79 release).
2017-08-30Refactor 'split faces' mesh code.Bastien Montagne
Previous version was trying to do a quick and simple process in the case we were only considering smooth/flat status of faces. Thing is, even then, the algorithm was not actually working in all possible situations, e.g. two smooth faces having a single vertex in common, but no common edges, would not have split that vertex, leading to incorrect shading etc. So now, tweaked slightly our split normals code to be able to generate lnor spaces even when autosmooth is disabled, and we always go that way when splitting faces. Using smooth fans from clnor spaces is not only the only way to get 100% correct results, it also makes face split code simpler.
2017-08-07Refactor ID copying (and to some extent, ID freeing).Bastien Montagne
This will allow much finer controll over how we copy data-blocks, from full copy in Main database, to "lighter" ones (out of Main, inside an already allocated datablock, etc.). This commit also transfers a llot of what was previously handled by per-ID-type custom code to generic ID handling code in BKE_library. Hopefully will avoid in future inconsistencies and missing bits we had all over the codebase in the past. It also adds missing copying handling for a few types, most notably Scene (which where using a fully customized handling previously). Note that the type of allocation used during copying (regular in Main, allocated but outside of Main, or not allocated by ID handling code at all) is stored in ID's, which allows to handle them correctly when freeing. This needs to be taken care of with caution when doing 'weird' unusual things with ID copying and/or allocation! As a final note, while rather noisy, this commit will hopefully not break too much existing branches, old 'API' has been kept for the main part, as a wrapper around new code. Cleaning it up will happen later. Design task : T51804 Phab Diff: D2714
2017-06-21Fix T51856: `BKE_mesh_new_from_object()` would often generate default 'Mesh' ↵Bastien Montagne
named datablock. This is annoying especially for exporters who do use mesh name, since it broke any relation with actual Mesh naming in original Blend file. Unfortunately, we cannot avoid the extra .xxx digits. ;)
2017-06-15Fix/workaround 'convert object' messing up linked data.Bastien Montagne
'Convert To...' Object operation has very weird effect of actually working at obdata level, not object level, which means *all* objects (even unselected/hidden/in other scenes/...) using same obdata will be converted to new selected type. IMHO this is very bad behavior, but... not a bug really, so do not change this for now. But at least, do not do that when working on some linked data, else it leaves Blend file in invalid (incoherent) state until next reload. So workaround for now is to enforce the 'Keep Original' option when some linked object/obdata is affected by the operation. Also fixed somewhat broken usercount handling in Curve->Mesh part.
2017-06-15Fix serious bug in 'curve-to-mesh' conversion code.Bastien Montagne
Eeeeeek!^2 Calling unconditionnaly ID freeing `BKE_libblock_free()` on a datablock (ob->data, i.e. Curve) that may be used elsewhere... Veryveryvery bad!
2017-06-14Make whole ID copying code use const source pointer.Bastien Montagne
Noisy change, but safe, and better do it sooner than later if we are to rework copying code. Also, previous commit shows this *is* useful to catch some mistakes.
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-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-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-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-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.