Blender Git Loki
Git Commits -> Revision 6940bf0
Revision 6940bf0 by Lukas Toenne (master) January 21, 2014, 11:11 (GMT) |
Code cleanup and structural improvements for dupli generation. This is a first step toward improving our dupli system. It implements a more generic way of treating the various methods of dupli generation by adding a few structs: * DupliContext holds a number of arguments commonly used in the recursive dupli functions and defines a recursion state for generating sub-duplis (nested groups). It also helps to prevent bloated argument lists. * DupliGenerator is a type struct that unifies the different dupli creation methods (groups, frames, verts, text chars, faces, particles). (As with context there should be no overhead from pointer indirection because everything can still be inlined inside anim.c) Beside making the code more easily understandable this implementation should also help to avoid weird side effects from custom matrix hacks by defining clearly what a generator does. The DupliContext is deliberately made const, so a generator can not simply add hidden matrix or flag modifications that are hard to track down. The result container for the generated duplis is stored in the context instead of being passed explicitly. This means the generators are oblivious to the storage of duplis, all they need to do is call the make_dupli function. This will allow us to implement more efficient ways of storing DupliObject instances, such as MemPools or batches. These can be implemented alongside the current ListBase so we can improve dupli bottlenecks without having to replace each and every dupli use case at once. Differential Revision: https://developer.blender.org/D189 |
Commit Details:
Full Hash: 6940bf0c96f46db78dd139a1b0246e6bcb0fe8c2
Parent Commit: 0c9d897
Lines Changed: +1245, -1156
1 Added Path:
/source/blender/blenkernel/intern/object_dupli.c (+1241, -0) (View)