Blender Git Loki

Blender Git "alembic" branch commits.

Page: 23 / 29

March 26, 2015, 13:13 (GMT)
Use a new flag in duplicator objects to enable cache reading and avoid
unnecessary dependencies.

This flag will replace the current "read" mode on cache libraries.

Beside enabling cache reading, it also disables the current "fake"
dependencies between duplicators and their group objects. This is
exploiting the layer visibility mechanism in depsgraph to ensure that
animated group objects get evaluated when used by a visible duplicator,
even when they are not themselves visible. These dependencies cause
group object updates even if the duplicator is using cached results.
To avoid this unnecessary overhead and make caching worthwhile we
rebuild depsgraph without these relations when using the cache instead.
March 26, 2015, 13:13 (GMT)
Disable additional depsgraph tagging through cache libraries.

This code is outdated due to changes in reading code and obscures some
genuine depsgraph behavior.
March 26, 2015, 13:13 (GMT)
Enable frame updates of duplicache through use of an invalidation flag.
March 26, 2015, 13:13 (GMT)
Removed the now redundant "Read" toggle from cache libraries.

At this point the reading is toggled on the side of group duplicators.
March 26, 2015, 13:13 (GMT)
Removed the explicit duplicache rebuild operator.

The cache is now updated on frame changes automatically, the operator
should no longer be needed.
March 26, 2015, 13:13 (GMT)
Added a cache library pointer to objects as a replacement for CL->GR
pointers.

Relationship between CacheLibrary, duplicator Objects and Groups is
difficult. There are a number of somewhat conflicting goals:
- CacheLibraries write out data for objects and dupli groups. Multiple
objects can be stored in the same cache: CL *->* GR
- Objects can override a dupli group with different caches: OB *->1 CL
- As before, each object can be the duplicator for one group: OB *->1 GR

To combine these requirements, the first relationship will be made
indirect. Only the Object -> Group/CacheLib relations are explicit
pointers in the DNA. For finding all objects contained in a cache
library the usual recursive DNA tagging system must then be used.
March 26, 2015, 13:13 (GMT)
Sanity check for dupligroup caching functions.
March 26, 2015, 13:13 (GMT)
Simplification of the archive init functions in writers and readers.

Now the base types for readers/writers are not nominally forming the
interface any more (they may be removed entirely later). This makes
possible a cleaner init method directly in the Abc Writer/Reader
classes.

Further work may be required in this area.
March 26, 2015, 13:13 (GMT)
Mesh storage and reading in child objects for dupligroups.

The layout of the Alembic files resembles the DNA structure in Blender:
- On the top level (under the top/root node) there are Abc::Objects for
Blender ID datablocks (currently Object and Group)
- Objects store final data (DerivedMesh) and later simulation results
etc.
- Groups store their full duplilists for instancing. Currently there is
no recursive nesting of groups, since this would limit duplis to
dupligroups and exclude e.g. duplifaces.

On reading the duplilist gets reconstructed and stored in the DupliCache
for a duplicator empty (the group instance). DerivedMesh data is stored
in a hash table for each instanciated object and can later replace
finalDM in drawing and rendering.
March 26, 2015, 13:13 (GMT)
Removed unused deprecated functions for cache library.
March 26, 2015, 13:13 (GMT)
Alternative dupli generator function for creating duplis in a group
without a specific parent.
March 26, 2015, 13:13 (GMT)
Use a cached group only when a CacheLibrary is actually available.

Otherwise the regular duplilist generator is used.
March 26, 2015, 13:13 (GMT)
Store and apply dupli object transforms in the Alembic cache.

Note that the cache stores dupli matrices without the final parent
transform, since it only knows about the group itself. The duplicator
obmat is applied to the duplis after reading the cache.
March 26, 2015, 13:13 (GMT)
Store object pointers for the dupli objects we generate from caches.

This is necessary for the current viewport drawing and rendering code,
which expected each dupli instance to represent a copy of data in the
DNA.

The code maps base-level objects in the cache to DNA Objects inside the
dupligroup by name. Only objects that can be found in the blend data
will be allowed for DupliObjects.
March 26, 2015, 13:13 (GMT)
Moved the DupliCache struct into DNA, it will be needed for drawing and
RNA access later.
March 26, 2015, 13:13 (GMT)
Better dupligroup Alembic writer.

Uses the duplilist generated by Blender to define instances, instead of
recreating the group layout. This omits some information about actual
structure of the DNA, which might be useful later on. The main problem
is that the duplilist itself does not encode this, so it's a tradeoff
between either including the Group structure or omitting the other
dupli types, like face, vertex, particle duplis.
March 26, 2015, 13:13 (GMT)
Moved the dupli cache reading code into a AbcDupligroupReader class.

This is more in line with how readers work in the Blender Alembic
implementation elsewhere.

Generally, readers are less persistent than writers: they are created
whenever cache results need to be updated (e.g. on frame changes) and
discarded afterward. Writers OTOH stay alive during the whole baking
job, since they keep the references to Alembic Writer instances and can
only be deleted once the writing for that part is done.
March 26, 2015, 13:13 (GMT)
Simple operator to force rebuilding of a dupligroup cache.

This is a placeholder for proper depsgraph integration. Eventually frame
changes and some other updates should rebuild dupligroup caches
automatically using the depsgraph. Until then this operator is a quick
way to test the IO from caches and the further drawing and rendering
(TODO).
March 26, 2015, 13:13 (GMT)
Some disabled code to enable automatic cache updates on every duplilist
creation call.

This is executed *a lot* (even for simple things such as viewport
panning), so the code is probably not suitable in this form. At least
it could do a frame comparison to avoid unnecessary updates.
March 26, 2015, 13:13 (GMT)
Handle dupli cache on object copy and freeing.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021