Age | Commit message (Collapse) | Author |
|
|
|
The point cache code needs a non NULL rbw pointer.
This could have been avoided if there was a sanity check in the convert
function, so added a check there as well.
|
|
Blender tried to free objects twice from the bullet world sometime.
First we would implicity remove all objects when recreating the bullet
world and then explicity try to remove them again from the now empty
world.
This would wouldn't crash older bullet versions, but the recent versions
will as we will try to free objects that no longer exists in the bullet
world.
Also clear the cache on deletion as the object order changes.
Fix T77181: The cache clearing will fix this issue.
|
|
The animated objects was not updated for each internal substep for the rigidbody sim.
This would lead to unstable simulations or very annoying clipping artifacts.
Updated the code to use explicit substeps and tie it to the scene frame rate.
Fix T47402: Properly updating the animated objects fixes the reported issue.
Reviewed By: Brecht, Jacques
Differential Revision: http://developer.blender.org/D8762
|
|
The new BKE_rigidbody_is_affected_by_simulation function was in side the
WITH_BULLET ifdef guard.
|
|
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
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.
No functional changes.
|
|
|
|
This patch adds a new compound shape entry to the shape selection
dropdown. It also corrects wrong inertia calculation for convex hulls,
that resulted in strange behavior for small objects.
The compound shape take the collision shapes from its object children
and combines them. This makes it possible to create concave shapes from
primitive shapes. Using this instead of the mesh collision shape is
often many times faster.
Reviewed By: Sergey, Sebastian Parborg
Differential Revision: http://developer.blender.org/D5797
|
|
Currently all force effectors can only act on cloth when the force is
perpendicular to the surface. This makes sense for wind, but not for
other forces; and the user may want even wind to have some friction.
This changes effector code to output two force vectors - although
you of course can pass the same pointer for both. The force is split
between the two outputs based on a new per-effector setting.
Differential Revision: https://developer.blender.org/D8017
|
|
|
|
Would just silently fail, which is confusing.
Should only impact custom builds.
|
|
This just adds a check to prevent the crash,
Versioning invalid types still needed.
|
|
|
|
This is in preparation of new object types. This only changes mesh_eval, we
may do the same for mesh_deform_eval and other areas in the future if there is
a need for it.
This previously caused a bug in T74283, that should be fixed now.
Differential Revision: https://developer.blender.org/D6695
|
|
than mesh"
This reverts commit f2b95b9eae2ee913c99cff7595527b18d8b49d0a.
Fix T74283: modifier display lost when moving object in edit mode.
The cause is not immediately obvious so better to revert and look at this
carefully.
|
|
This is in preparation of new object types. This only changes mesh_eval, we
may do the same for mesh_deform_eval and other areas in the future if there is
a need for it.
Differential Revision: https://developer.blender.org/D6695
|
|
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.
Part of T72604.
|
|
Was crashing due to RBW mssing shared->physics_world [which can happen
when undoing the deletion of the last object in the world].
This can be gained back by BKE_rigidbody_validate_sim_world.
Reviewed By: mont29
Maniphest Tasks: T70667
Differential Revision: https://developer.blender.org/D6037
|
|
Sorry for the noise... For once building with everything hid the issue
instead of revealing it.
|
|
|
|
Fixing/working around another weakness of current RBW model... This is
not really nice, but it should work for now, and we cannot really do
anything else but that kind of monkey patching here anyway.
|
|
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.
|
|
In its current version that was a totally useless extra layer of crap
that we can totally avoid. Plus name was bad too.
|
|
|
|
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...
|
|
|
|
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.
|
|
While user should never do that, it appears many end up using a 'view
layer' instancing collection as RBW collection, and even worse, have
objects in that unique collection.
Therefore, when removing RB simulation from an object, which among other
things has to remove it from the RBW collection, it would fully delete
the object from the blend file.
This fix merely checks the usercount of RB-removed object, and if it is
at 1 (which means object was in a single collection), it adds it to the
scene's master collection first.
|
|
|
|
We still have base->flag_legacy & BA_WAS_SEL for the few cases we really
need to have a per-object selection check (used in the transform code).
|
|
|
|
|
|
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
|
|
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.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
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.
|
|
Part of D4277 by @sobakasu
|
|
This removes a bunch of animation/driver evaluations and recalc flags that
should be redundant in the new depsgraph, and were incorrectly affecting
the evaluated scene in a permanent way.
Still two cases that could be removed if the depsgraph is improved, in
BKE_object_handle_data_update and BKE_cachefile_update_frame.
For physics subframe interpolation there are also still calls to
BKE_object_where_is_calc that should ideally be removed as well, though
they are not known to cause keyframing bugs.
Differential Revision: https://developer.blender.org/D4274
|
|
|
|
|
|
collection.
We have to ensure objects get expected RB data, when they are added to a
RB collection...
|
|
|
|
Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.
|
|
Stick to an existing way of dealing with disabled feature.
|
|
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.
|
|
|
|
|
|
Also use unsigned shifting for values not in int range.
|