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
2022-04-11Cleanup: malformed C-style comment blocks, spellingCampbell Barton
- Missing star prefix. - Unnecessary indentation. - Blank line after dot-points (otherwise doxygen merges with the previous dot-point). - Use back-slash for doxygen commands. - Correct spelling.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-10Cleanup: move public doc-strings into headers for various API'sCampbell Barton
Some doc-strings were skipped because of blank-lines between the doc-string and the symbol and needed to be moved manually. - Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. Ref T92709
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-10-06Cleanup: clang-format, correct doxy groupsCampbell Barton
2020-08-28Fix Rigidbody depsgraph passive and constraint transform relations.Sebastian Parborg
We need to have transforms from passive objects if they are animated or driven by parent relations. This is not immediately obvious as the object transform matrix will still be available, it is just one frame behind in some cases. Fixed dependency cycles if there is a constraint between two rigid bodies. Because bullet keeps track of its simulated bodies, we do not need to supply objects transforms as bullet should already have them. I need combine these two fixes because otherwise we will get depsgraph warnings that nodes are missing that it expects to be there. Reviewed By: Sergey, Jacques Differential Revision: http://developer.blender.org/D8732
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-04-05Cleanup: macro hygiene, parenthesize argumentsCampbell Barton
2020-03-02Cleanup: make remaining blenkernel headers work in C++Jacques Lucke
2019-10-04Fix assert when deleting a RBW constraint object.Bastien Montagne
Side-reported in T70505. Code did not ensure deleted object was removed from the RBW constraints collection, leading to some invalid status (object in constraints collection but without relevant contraints data). Also fixed another issue - code deleting RBW objects would try to remove any constraint one using it as target, in a very bad and broken way, since you cannot iterate over objects of a collection while removing some... Now instead just NULLify relevant pointers... I hope it works, otherwise we'll have to take a different approach. Needless to stress again how weak the whole RBW code is in general, and regarding same object being used by RBW in more than one scene in particular, that is known broken situation anyway.
2019-07-16Fix T66944: Rigid Body Constraint in duplicated collection is not added to ↵Bastien Montagne
RigidBodyConstraints collection. We only had a very limited, specific handling of that in collection duplication code, but this has to be handled at a much more general level in Object copy code itself, since it makes no sense to duplicate rigidbody object data without adding new copy to relevant rigidbody collections... WARNING: This is a fairly risky rework of rigidbody handling logic when copying an Object data-block. It is *NOT* considered safe enough for 2.80 release. I tried to take into account copy flags to not mess with other IDs (collections) when we are copying outside of Main, and also not do deg tags when this is forbidden, but risk of something going wrong here is too high...
2019-06-24Fix T63828, T62005: copy/paste or append loses rigid body objectBrecht Van Lommel
Previously settings were removed, now add to the rigid body world automatically even if it's a bit ill defined, since this is confusing for users. Fundamentally the concept of a rigid body world collection could be revised, and left only as an optional thing.
2019-04-27Cleanup: comments (long lines) in 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-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-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-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-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-12-12Fix (unreported) Broken rigidbody requirements when adding objects to a RB ↵Bastien Montagne
collection. We have to ensure objects get expected RB data, when they are added to a RB collection...
2018-12-10Proper fix for rigidbody collections's objects missing rb data.Bastien Montagne
We cannot let those data be generated on-the-fly in RBW evaluation anymore, since those would be added to CoW eval object and never ported back to orig objects. We *could* get orig objects in eval code, of course, but as in constratints, this is not really threadsafe and future proof, depsgraph evaluation should really write back to orig data as little as possible. So instead, add code to ensure required data is generated to objects when their collection is added to rigidbody world. Note that we *may* want to clean that up once collection is no more used by RB? On the other hand, people might want to keep those data around to be able to switch between different setups easily... So think it's OK to keep them at least for now.
2018-06-28Prevent copying too much in the Rigid Body simulationSybren A. Stüvel
To prevent the pointcache from being copied-on-write too (and requiring copying back), the cache is now shared between the original and evaluated scenes. Reading from the cache is always allowed; running the sim and writing to the cache is only allowed when the depsgraph is active. Some pointers have moved from RigidBodyWorld (RBO) to RigidBodyWorldShared (RBOS). writefile.c copies some pointers back from RBOS to RBO so that the file can still be opened on older Blenders without crashing on a segfault. The RigidBodyWorldShared struct is written to the blend file, because it refers to the PointCache ID block. The RigidObjectShared struct is runtime-only, and thus not saved to the blend file. An RNA getter-function is used to hide the new 'shared' pointer. As a result the Python API hasn't changed. Reviewed by: campbellbarton Differential Revision: https://developer.blender.org/D3508
2018-06-19Remove rigid body from rbw->group when deletingSybren A. Stüvel
I moved some code from ED_rigidbody_object_remove() to BKE_rigidbody_remove_object(), so that calling the latter doesn't leave the object in rbw->group (causing a crash later on when rebuilding the depsgraph).
2018-06-17Merge branch 'master' into blender2.8Campbell Barton
2018-06-17Cleanup: trailing space for blenkernelCampbell Barton
2018-04-16Depsgraph: remove EvaluationContext, pass Depsgraph instead.Brecht Van Lommel
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
2017-08-16Pass EvaluationContext instead of bContextCampbell Barton
2.8x branch added bContext arg in many places, pass eval-context instead since its not simple to reason about what what nested functions do when they can access and change almost anything. Also use const to prevent unexpected modifications. This fixes crash loading files with shadows, since off-screen buffers use a NULL context for rendering.
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-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-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-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-01-31Cleanup: use 'cb_flag', not 'cd_flag' for library_query callbacks.Bastien Montagne
`cd_flag` tends to be used for CustomData flags in mesh area, while for library_query those are rather callback flags...
2016-12-12Cleanup: Get rid of unused BKE_rigidbody_relink_constraint().Bastien Montagne
Also use proper ID_NEW_REMAP macro in BKE_rigidbody_world_groups_relink()!
2015-10-08Add rigidbodyworld to id looper.Bastien Montagne
2015-07-19Cleanup: styleCampbell Barton
Also 'com' as abbreviation for center-of-mass is a bit confusing, rename to 'center'.
2015-05-12Depsgraph: Add evaluation callbacks for granular nodes updateSergey Sharybin
This commit only adds callbacks which then later be used with major dependency graph commit, keeping the upcoming commit more clean to follow. Should be no functional changes so far still.
2015-03-28Cleanup: redundant struct declarationsCampbell Barton
2014-07-11Fix T41019: Calculate Mass does not calculate actual volume.Lukas Tönne
This was a ToDo item, for mesh-based rigid body shapes (trimesh, convex) the operator was simply using the bounding box volume, which can grossly overestimate the volume and mass. Calculating the actual volume of a mesh is not so difficult after all, see e.g. http://research.microsoft.com/en-us/um/people/chazhang/publications/icip01_ChaZhang.pdf This patch also allows calculating the center-of-mass in the same way. This is currently unused, because the rigid body system assumes the CoM to be the same as the geometric object center. This is fine most of the time, adding such user settings for "center-of-mass offset" would also add quite a bit of complexity in user space, but it could be necessary at some point. A number of other physical properties could be calculated using the same principle, e.g. the moment of inertia.
2013-12-27Rigidbody: Code cleanupSergej Reich
Make some functions private. Remove unneeded nested if statements. Avoid mixing short and bool.
2013-11-01code cleanup: spellingCampbell Barton
2013-04-25Fix #34806: rigid body world settings were not copied with a full scene copy.Brecht Van Lommel
Now copying a scene will also duplicate groups that consist entirely of objects that are duplicated with the scene. The rigid body world will then also pointers to these new groups.
2013-04-07rigidbody: Fix/workaround for transforming rigid bodies with parentsSergej Reich
Since we use the rigid body transform when transforming rigid bodies things like parents and constraints add an offset because rigid body transforms are in global space. Now we just don't take rigid body transform into account on simulation start frame so there are no problems when doing the initial setup. The problem still exists when simulation is running of course. To properly fix this we'd have to solve parenting and constratins while taking rigid bodies into account before and after transform. We'll have to see if it's really needed, would like to avoid it though.
2013-03-03rigidbody: Fix inconsistency with world rebuildingSergej Reich
The rigid body world could be rebuilt on start frame and one frame after start frame. The latter was necessary sice animation playback usually doesn't start at start frame. This lead to different simulations depending on which frame the simulaton was rebuilt when animation was involved. Now we only rebuild the world on start frame. This is actually tricky to do since, as mentioned above, animation playback starts on second frame. To work around this we rebuild the world before the actual update. The alternative would be to rebuld the world on every simulation change (like the other simulations do it) but this is an expensive operation and would be too slow.
2013-02-16rigidbody: Further fix for background scenesSergej Reich
Since rigid bodies need their world to be be updated correctly we now pass it alongside the parent scene in scene_update_tagged_recursive(). Add BKE_object_handle_update_ex() as well as other object functions that take a RigidBodyWorld for this. Ideally this shouldn't be needed but we'd have to restructure scene handling for that. It's not a small taks however and definitely not something that can be done before release. Thanks to Campbell for review.
2013-02-09rigidbody: Relink constraints when duplicating objectsSergej Reich
This will preserve constraint <-> rigid body realationships so constraint setups aren't broken after duplication. Based on a patch by Brandon Hechinger (jaggz), thanks.
2013-01-23rigidbody: Make rigid bodies kinematic during transformationSergej Reich
This allows moving rigid bodies on frame > startframe. Also rigid bodies can now be picked up and trown around while the simulation is running. Note: There is a small glitch with cancelling tansform during simulation but it's tricky to get rid of. TODO: Avoid static-static collision warnings
2013-01-23rigidbody: Add DNA/RNA/BKE infrastructure for the rigid body simSergej Reich
This is just the basic structure, the simulation isn't hooked up yet. Scenes get a pointer to a rigid body world that holds rigid body objects. Objects get a pointer to a rigdid body object. Both rigid body world and objects aren't used directly in the simulation and only hold information to create the actual physics objects. Physics objects are created when rigid body objects are validated. In order to keep blender and bullet objects in sync care has to be taken to either call appropriate set functions or flag objects for validation. Part of GSoC 2010 and 2012. Authors: Joshua Leung (aligorith), Sergej Reich (sergof)