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
2019-08-23RNA: Cleanup PointerRNA structJacques Lucke
The old layout of `PointerRNA` was confusing for historic reasons: ``` typedef struct PointerRNA { struct { void *data; } id; struct StructRNA *type; void *data; } PointerRNA; ``` This patch updates it to: ``` typedef struct PointerRNA { struct ID *owner_id; struct StructRNA *type; void *data; } PointerRNA; ``` Throughout the code base `id.data` was replaced with `owner_id`. Furthermore, many explicit pointer type casts were added which were implicit before. Some type casts to `ID *` were removed. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D5558
2019-06-17Fix T63867: image sequence not updating in Eevee animation renderBrecht Van Lommel
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-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-04-17ClangFormat: format '#if 0' code in intern/Campbell 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-04Fix T60379: Cycles viewport adaptive subdivision hangs after updates.Brecht Van Lommel
The camera world to raster computation was using wrong values. Also fixes update when changing subdivision scene settings.
2019-03-19Merge branch 'blender2.7'Brecht Van Lommel
2019-03-19Cycles: add cycles.merge_images operator for combing EXR renders.Brecht Van Lommel
This is only available through the API, mainly intended for render farms to combine rendered multilayer EXR Files with different samples. The images are currently expected to have the exact same render layers and passes, just with different samples. Variance passes are still simply a weighted average, ideally these should be merged more intelligently. Differential Revision: https://developer.blender.org/D4554
2019-03-17Cleanup: remove unused code.Brecht Van Lommel
2019-01-21Fix T60683, T60662: Cycles render crash in edit mode for certain meshes.Brecht Van Lommel
2019-01-18Fix T60615: Cycles baking not working with some modifiers.Brecht Van Lommel
Refactors Cycles mesh export a bit to avoid unnecessary copies and to be in sync with the Blender baker.
2018-11-09Merge branch 'master' into blender2.8Sergey Sharybin
2018-11-09Cycles: Cleanup, split array from vectorSergey Sharybin
Those are similar but different types, no reason to keep their definitions in a single file.
2018-11-09Cycles: Cleanup, spacing after preprocessorSergey Sharybin
It is supposed to be two spaces before comment stating which if else/endif statements corresponds to. Was mainly violated in the header guards.
2018-11-08Merge branch 'master' into blender2.8Brecht Van Lommel
2018-11-08Cycles: Write Cryptomatte metadata according to the specificationLukas Stockner
Reviewers: brecht, sergey, swerner Subscribers: creamsurfer, Tanguy, Noss, SteffenD Differential Revision: https://developer.blender.org/D3862
2018-10-11RNA: remove redundant new_from_object/to_mesh argCampbell Barton
If the caller wants loop-tris, there is a function to calculate them.
2018-10-10Python API: add loop triangles access, remove tessfaces.Brecht Van Lommel
Loop triangles are tessellated triangles create from polygons, for renderers or exporters that need to match Blender's polygon tesselation exactly. These are a read-only runtime cache. Tessfaces are a legacy data structure from before Blender supported n-gons, and were already mostly removed from the C code. Details on porting code to loop triangles is in the release notes. Differential Revision: https://developer.blender.org/D3539
2018-09-10Cleanup: remove unused field argsCampbell Barton
2018-07-01Merge branch 'master' into blender2.8Campbell Barton
2018-07-01RNA: use bool for boolean RNA typesCampbell Barton
We were using int's for bool arguments in BKE, just to avoid having wrapper functions.
2018-06-11Cycles: Cleanup, silence strict compiler warningSergey Sharybin
There is one legit place in the code where memcpy was used as an optimization trick. Was needed for older version of GCC, but now it should be re-evaluated and checked if it still helps to have that trick. In other places it's somewhat lazy programming to zero out all object members. That is absolutely unsafe, at the moment when less trivial class is used as a member in that object things will break. Other cases were using memcpy into an object which comes from an external library. We don't control that object, and we can not guarantee it will always be safe for such memory tricks and debugging bugs caused by such low level access is far fun. Ideally we need to use more proper C++, but needs to be done with big care, including benchmarks of each change, For now do annoying but simple cast to void*.
2018-06-11Merge branch 'master' into blender2.8Bastien Montagne
2018-05-27Merge branch 'master' into blender2.8Lukas Stockner
2018-05-27Cycles: Fix problems in the IES loader when rendering with no file selectedLukas Stockner
2018-05-27Merge branch 'master' into blender2.8Campbell Barton
2018-05-27Cycles: Add Support for IES files as textures for light strengthLukas Stockner
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources. The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp. Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried. Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file. The user interface of the node is similar to the script node, the user can either select an internal Text or load a file. Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot. The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light, rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport. Reviewers: #cycles, dingto, sergey, brecht Reviewed By: #cycles, dingto, brecht Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey Differential Revision: https://developer.blender.org/D1543
2018-05-22Fix some Cycles modifier stack issues with copy-on-write.Brecht Van Lommel
There's still many problems, but this avoids modifiers being applied twice, subsurf render levels not being respected and hair render crashing.
2018-04-13Python API: remove preview/render resolution settings from API functions.Brecht Van Lommel
For correct results these must have been set already when the depsgraph was created and evaluated, so all dependencies have appropriate resolutions too. For particle we no longer backup and restore the viewport particles to avoid overwriting them during render, as copy-on-write solves this for us. Even without COW particles seem to work ok. This also removes the particle simplification options based on camera. This was never used much and only available in Blender Internal. Differential Revision: https://developer.blender.org/D3148
2018-03-10Merge branch 'master' into blender2.8Brecht Van Lommel
2018-03-10Cycles: support arbitrary number of motion blur steps for objects.Brecht Van Lommel
2018-03-10Code refactor: make Transform always affine, dropping last row.Brecht Van Lommel
This save a little memory and copying in the kernel by storing only a 4x3 matrix instead of a 4x4 matrix. We already did this in a few places, and those don't need to be special exceptions anymore now.
2017-11-23Rename any instance of scene layer or render layer in code with view layerDalai Felinto
The RenderResult struct still has a listbase of RenderLayer, but that's ok since this is strictly for rendering. * Subversion bump (to 2.80.2) * DNA low level doversion (renames) - only for .blend created since 2.80 started Note: We can't use DNA_struct_elem_find or get file version in init_structDNA, so we are manually iterating over the array of the SDNA elements instead. Note 2: This doversion change with renames can be reverted in a few months. But so far it's required for 2.8 files created between October 2016 and now. Reviewers: campbellbarton, sergey Differential Revision: https://developer.blender.org/D2927
2017-07-21Pass EvaluationContext argument everywhereLuca Rood
Note that some little parts of code have been dissabled because eval_ctx was not available there. This should be resolved once DerivedMesh is replaced.
2017-07-21Fix a few harmless maybe uninitialized warnings with GCC 5.4.Brecht Van Lommel
GCC seems to detect uninitialized into function calls now, but then isn't always smart enough to see that it is actually initialized. Disabling this warning entirely seems a bit too much, so initialize a bit more now.
2017-05-30Cycles: Cleanup, trailing whitespaceSergey Sharybin
2017-04-04Cycles: Fix uninitialized memory access when comparing curve mapping nodesSergey Sharybin
The issue is coming from the fact that float3 is actually 16 bytes aligned data type and the "padding" was not initialized. This caused memcmp() to access non-initialized memory.
2017-03-29Cycles: Make all #include statements relative to cycles source directorySergey Sharybin
The idea is to make include statements more explicit and obvious where the file is coming from, additionally reducing chance of wrong header being picked up. For example, it was not obvious whether bvh.h was refferring to builder or traversal, whenter node.h is a generic graph node or a shader node and cases like that. Surely this might look obvious for the active developers, but after some time of not touching the code it becomes less obvious where file is coming from. This was briefly mentioned in T50824 and seems @brecht is fine with such explicitness, but need to agree with all active developers before committing this. Please note that this patch is lacking changes related on GPU/OpenCL support. This will be solved if/when we all agree this is a good idea to move forward. Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner Reviewed By: lukasstockner97, maiself, nirved, dingto Subscribers: brecht Differential Revision: https://developer.blender.org/D2586
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-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-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-10Cycles: Cleanup, move EdgeMap to blender_utilSergey Sharybin
it's better place for such an utility structure. Still not fully ideal tho.
2017-01-11Cycles: Fix wrong motion blur when combining deformation motion blur with ↵Sergey Sharybin
autosplit The issue was that we used to compare number of vertices for mesh after the auto smooth was applied (at the center of the shutter time) with number of vertices prior to the auto smooth applied. This caused false-positive consideration of a mesh as changing topology. Now we do autosplit as early as possible and do it from blender side, so Cycles does not need to re-implement splitting on it's side.
2017-01-11Cycles: Pass explicit subdivision type to object_to_meshSergey Sharybin
This allows us to do some extra logic checks there based on particular subdivision type. Additionally avoids implicit cast of enum to bool.
2016-09-19Cycles: Fix typo that would sometimes result in subsurf modifier being disabledMai Lavelle
2016-09-18Cycles: Fix update of subdivision meshes when global dice rates changeMai Lavelle
When subdivision settings were moved from meshes to objects this was missed, should work fine now.
2016-08-18Fix T48913: cycles viewport render stuck in loop due to non-unique dupli ID.Brecht Van Lommel
2016-07-29Cycles microdisplacement: move subdivision options to subsurf modifierMai Lavelle
Subdivision options can now be found in the subsurf modifier. The modifier must be the last in the stack or the options will be unavailable. Catmull-Clark subdivision is still unavailable and will fallback to linear subdivision instead Reviewed By: brecht Differential Revision: https://developer.blender.org/D2109