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-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-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)