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
2020-01-30Fix T65146: Curve Texture Coordinates in Cycles and Eevee differClément Foucault
Remove the use UV for mapping option.
2019-09-23Cleanup: remove unimplemented texture space rotation variablesBrecht Van Lommel
2019-09-23Cleanup: remove Mesh.bb and Curve.bb, no reason for these to be persistentBrecht Van Lommel
These were only strictly valid for texture space calculation, don't store them since they should not be used after that. Only store a flag to indicate if the auto texture space has been evaluated. In the future it might make sense to store bounding boxes at the mesh level to speed up bounding box computation for multiple objects using the same mesh, but then it will need to be implemented differently.
2019-09-19Fix T67724: Cycles renders metaballs with wrong texture spaceBrecht Van Lommel
2019-09-15fix: (unreported) When converting nurbs or curves to Mesh the generated ↵Gaia Clary
UVMap is now named 'UVMap'
2019-09-12Cleanup: line breaks with commentsCampbell Barton
2019-08-25Cleanup: remove unused DM_to_mesh functionCampbell Barton
2019-08-21Cleanup: vertex coordinate access, naming & minor changesCampbell Barton
This also splits vertex access and allocation so it's possible to copy coordinates into an existing array without allocating it.
2019-08-15Cleanup: fix compiler warningsBrecht Van Lommel
2019-08-02Fix T68135: Do not return NULL/None when converting an object to a mesh.Bastien Montagne
Does not make sense in the use-cases of that function, especially since we don't know whether it is actually due to an error, or some glitch (like an empty curve). Think we always want to get a mesh when using either operator conversion, or the `bpy.data.meshes.new_from_object` function. Note that an assert was also added to ensure we do try to convert from a valid 'geometry' object type.
2019-08-02Cleanup: spellingCampbell Barton
2019-07-10Fix T66631: Crash when converting objects from Curve to MeshSybren A. Stüvel
When `BKE_mesh_new_from_object()` cannot convert an object to a mesh, it returns `NULL`. This case was not handled at all in `BKE_mesh_new_from_object_to_bmain()` or `curvetomesh()`, causing a segmentation fault. This commit fixes the segmentation fault, and leaves the curve object as a curve object. Reviewed By: mont29, brecht, sergey Differential Revision: https://developer.blender.org/D5217
2019-06-09Fix T65638: memory leak - modifiers on curves.Bastien Montagne
We need to tag the `mesh_eval` of curve as owned, when we generate one, otherwise freeing code would not free it.
2019-06-03Fix T65352: bpy.data.meshes.new_from_object() doesn't increment user count ↵Bastien Montagne
for materials referenced by the mesh. We cannot do refcount operations in a non-Main ID, this is forbidden. While that whole func could probably use some love and refactor, for now sticking to minimal changes and just moving refcounting op after mesh has been transferred to Main database.
2019-05-27Fix (unreported) invalid handling of IDs usercount in ↵Bastien Montagne
`BKE_mesh_new_from_object_to_bmain()`. Would have broken usercount of mesh used as texco reference e.g.
2019-05-27Depsgraph API: Allow preserving custom data layersSergey Sharybin
This commit extends dependency graph API with an argument which denotes that all custom data layers are to be preserved. This forces modifier stack re-evaluation with more inclusive mask. Far from ideal, since this might fail in certain configurations with indirectly used objects which might be missing layers needed for the current object evaluation. But this is how it worked for a long time, so should be good enough for until more sophisticated solution is found. In order to use this new behavior two things are to be passed: - Pass keep_all_data_layers=True - Pass a valid dependency graph. The dependency graph is only needed if keep_all_data_layers=True and is NOT to be passed if keep_all_data_layers=False. If keep_all_data_layers=True the dependency graph MUST be passed. Reviewers: mont29, brecht Reviewed By: mont29 Maniphest Tasks: T64994, T64794 Differential Revision: https://developer.blender.org/D4940
2019-05-21Fix T64842: crash rendering files with bevel curvesBrecht Van Lommel
This is old logic that no longer makes sense in the new depsgraph, and causes issues when multiple threads try to modify the same bevel object. Differential Revision: https://developer.blender.org/D4913
2019-05-17Fix meshes.new_from_object() not preserving materialsSergey Sharybin
2019-05-16Use edit evaluated mesh when creating mesh for object in edit modeSergey Sharybin
Makes the result of object.to_mesh() and bpy.meshes.new_from_object() to be the same as what is visible in the viewport. This makes Cycles to respect modifiers enabled in edit mode, and should also easy some scripter's work. The final render still needs some work, which, maybe, will be about forcing objects out of editing modes.
2019-05-16Tweak API to support adding evaluated meshes to main databaseSergey Sharybin
One of the usecases is to create mesh from an object is a manner similar to how Apply Modifiers does it, and have it in the bmain so it can be referenced by other objects. This usecase is something what went unnoticed in the previous API changes, so here is a followup. Summary of changes: * bpy.meshes.new_from_object() behaves almost the same as before this change. The difference now is that it now ensures all referenced data-blocks are original (for example, materials referenced by the mesh). * object.to_mesh() now creates free-standing Mesh data-block which is outside of any bmain. The object owns it, which guarantees the memory never leaks. It is possible to force free memory by calling object.to_mesh_clear(). Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4875
2019-05-16Dependency graph API changesSergey Sharybin
Main goal here is to make it obvious and predictable about what is going on. Summary of changes. - Access to dependency graph is now only possible to a fully evaluated graph. This is now done via context.evaluated_depsgraph_get(). The call will ensure both relations and datablocks are updated. This way we don't allow access to some known bad state of the graph, and also making explicit that getting update dependency graph is not cheap. - Access to evaluated ID is now possible via id.evaluated_get(). It was already possible to get evaluated ID via dependency graph, but that was a bit confusing why access to original is done via ID and to evaluated via depsgraph. If datablock is not covered by dependency graph it will be returned as-is. - Similarly, request for original from an ID which is not evaluated will return ID as-is. - Removed scene.update(). This is very expensive to update all the view layers. - Added depsgraph.update(). Now when temporary changes to objects are to be done, this is to happen on original object and then dependency graph is to be updated. - Changed object.to_mesh() to behave the following way: * When is used for original object modifiers are ignored. For meshes this acts similar to mesh-copy, not very useful but allows to keep code paths similar (i.e. for exporter which has Apply Modifiers option it's only matter choosing between original and evaluated object, the to_mesh() part can stay the same). For curves this gives a mesh which is constructed from displist without taking own modifiers and modifiers of bevel/taper objects into account. For metaballs this gives empty mesh. Polygonization of metaball is not possible from a single object. * When is used for evaluated object modifiers are always applied. In fact, no evaluation is happening, the mesh is either copied as-is, or constructed from current state of curve cache. Arguments to apply modifiers and calculate original coordinates (ORCO, aka undeformed coordinates) are removed. The ORCO is to be calculated as part of dependency graph evaluation. File used to regression-test (a packed Python script into .blend): {F7033464} Patch to make addons tests to pass: {F7033466} NOTE: I've included changes to FBX exporter, and those are addressing report T63689. NOTE: All the enabled-by-default addons are to be ported still, but first want to have agreement on this part of changes. NOTE: Also need to work on documentation for Python API, but, again, better be done after having agreement on this work. Reviewers: brecht, campbellbarton, mont29 Differential Revision: https://developer.blender.org/D4834
2019-05-13Curve: Remove duplicated and confusing argumentSergey Sharybin
Curve function had two arguments: - for_render, which was originally supposed to be used to control whether viewport or render visibility for modifiers is to be used. - use_render_resolution, which sounds like it is supposed to control whether viewport or render resolution for curves is to be used. What is totally confusing is that those arguments were used interchangeably: sometimes use_render_resolution would control modifiers visibility. This commit makes it so there is one single argument for this. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4850
2019-04-29Fix T63616: applying armature modifier with another modifier under it doesnt ↵Bastien Montagne
apply right. Some deform modifiers (like armature) use passed Mesh parameter to retrieve some extra data (vgroups in our case), and default to obdata when it is not available. This should be fine in theory in the 'apply modifier to obdata' case, since this is always the first modifier, but here upper-level code passes **evaluated** object, not orig one, so ob->data is not orig anymore, and might miss some stuff... Note that am quiet unsure whether the way evaluated data is passed around in that apply modifier operator code is actually OK, but for now it seems to work at least...
2019-04-29Cleanup: internal apply modifier code: make it clear we use eval modifier ↵Bastien Montagne
and object.
2019-04-27Cleanup: comments (long lines) in blenkernelCampbell Barton
2019-04-22Cleanup: style, use braces for blenkernelCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-10Fix T63441: Cycles applies modifiers twiceSergey Sharybin
Was a mistake in df26f28835f, which caused access uninitialized variable.
2019-04-08Fix T63399: Obj exporter does not respect "Apply Modifiers" settingsSergey Sharybin
2019-04-03Fix T63217: Curve Modifier skipped in CyclesSergey Sharybin
Only mesh objects have all modifiers applied on the evaluated object's data, other object types are to apply modifiers during the conversion process.
2019-04-01Tweak behavior of object.to_mesh()Sergey Sharybin
- Passing original object with apply_modifiers=false will give a non-modified non-deformed mesh. The result mesh will point to datablocks from the original "domain". For example, materials will be original. - Passing original object with apply_modifiers=true will give a mesh which has all modifiers applied. The result mesh will point to datablocks from the original "domain". For example, materials will be original. - Passing evaluated object will ignore apply_modifiers argument, and the result always contains all modifiers applied. The result mesh will point to an evaluated datablocks. For example, materials will be an evaluated IDs from the dependency graph. Fixes T62916: Applying boolean modifier does not set material properly Differential Revision: https://developer.blender.org/D4604
2019-04-01Modifiers: Proper fix for the Apply ModifierSergey Sharybin
It is up to the operator to pass valid object to the modifiers evaluation. Fixes T62916: Applying boolean modifier does not set materials properly
2019-03-20Fix T60211: MemLeak Convert Curve To MeshJeroen Bakker
Ownership flag was not set, but was it was meanted to be. So the set runtime data to NULL disconnected the Mesh with no ownership.
2019-03-12Cleanup: BLI_utildefines struct macrosCampbell Barton
Use the term "AFTER" instead of "OFS" since it wasn't obvious these macros operate on everything after the struct member passed. Avoid casting to non-const types when only reading.
2019-03-08Cleanup: use plural names for Main listsCampbell Barton
Convention was not to but after discussion on 918941483f7e we agree its best to change the convention. Names now mostly follow RNA. Some exceptions: - Use 'nodetrees' instead of 'nodegroups' since the struct is called NodeTree. - Use 'gpencils' instead of 'grease_pencil' since 'gpencil' is a common abbreviation in the C code. Other exceptions: - Leave 'wm' as it's a list of one. - Leave 'ipo' as is for versioning.
2019-03-07Refactor CDData masks, to have one mask per mesh elem type.Bastien Montagne
We already have different storages for cddata of verts, edges etc., 'simply' do the same for the mask flags we use all around Blender code to request some data, or limit some operation to some layers, etc. Reason we need this is that some cddata types (like Normals) are actually shared between verts/polys/loops, and we don’t want to generate clnors everytime we request vnors! As a side note, this also does final fix to T59338, which was the trigger for this patch (need to request computed loop normals for another mesh than evaluated one). Reviewers: brecht, campbellbarton, sergey Differential Revision: https://developer.blender.org/D4407
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-14Fix T61353: Crash converting a curve to a meshCampbell Barton
This was caused by curves pointing to each other creating a cyclic dependency. While the dependency graph detects this, generating a mesh for render recursively generates data which cashes in this case. Add in a check to detect cyclic links. Note, this bug exists in 2.7x too - but only crashes on render since 2.7x didn't use 'for_render' when converting data.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-05Fix strict compiler warning, breaking MSVCSergey Sharybin
2019-02-05BKE_mesh_new_from_object(): do not generate temp obj/cu in Main.Bastien Montagne
When generating a mesh from a curve object, do not generate temp objects and curves in main, but rather as 'localized' copies. This is cleaner, and might add a marginal speed-up in some cases (like rendering thousands of curve objects), since we save some processing. Note that this is the function behind py API's `Object.to_mesh()` too.
2019-02-05Cleanup: Add precision to comment.Bastien Montagne
2019-02-05Cleanup: replace BKE_id_copy_ex by BKE_id_copy where possible.Bastien Montagne
That way it is obvious when we are using default ID copy behaviour, and when we are using advanced/specialized ones.
2019-02-05BKE_library: id_copy: More general usage of LIB_ID_COPY_LOCALIZE.Bastien Montagne
Turns out most of our 'local working copy' cases can use same set of flags. Note that this commit adds LIB_ID_COPY_CACHES to all our local meshes copying, however this is no-op since that flag is unused during mesh copying... We may want to add another set of flags without that one at some point, but for now it would not be useful imho.
2019-02-05Cleanup: BKE_library: remove 'test' param of id_copy.Bastien Montagne
This was used in *one* place only... much better to have a dedicated helper for that kind of things. ;)
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-02-01Logging: Use CLOG for blenkernelCampbell Barton
Part of D4277 by @sobakasu
2019-01-26Cleanup: remove redundant BKE/BLI/BIF headersCampbell Barton
2019-01-15Cleanup: rename BKE_libblock_free_us to BKE_id_free_us.Bastien Montagne
2019-01-15Cleanup: replace usages of deprecated BKE_libblock_free by BKE_id_free.Bastien Montagne