UI/Assets: Support generating object preview images
Object previews are really helpful for visual data-block selection, like asset
browsing. Having them be generative should also be quite handy and should work
well enough in many, if not most cases.
What this does is simple:
* Place the object (actually a deep copy of it, for thread safety) in a virtual
.blend into an empty scene/view-layer.
* Add a camera, point it towards the front of the object, assuming that means
pointing towards its +Y axis.
* Use "Camera Fit Frame to Selected" logic to put the object into frame.
* Create a threaded off-screen render.
Of course, such an automatic preview will not work in all situations. E.g. it
currently does a bad job capturing a single plane. We could add options for
more advanced automatic previews, but probably custom previews is more
important, which I committed already (812ea91842).
Part of the first Asset Browser milestone. Check the #asset_browser_milestone_1
project milestone on developer.blender.org.
Reviewed as part of https://developer.blender.org/D9719.
Reviewed by: Bastien Montagne, Brecht Van Lommel
This commit is contained in:
@@ -2208,7 +2208,9 @@ ParticleSystem *BKE_object_copy_particlesystem(ParticleSystem *psys, const int f
|
||||
BLI_listbase_clear(&psysn->childcachebufs);
|
||||
|
||||
if (flag & LIB_ID_CREATE_NO_MAIN) {
|
||||
BLI_assert((psys->flag & PSYS_SHARED_CACHES) == 0);
|
||||
/* XXX Disabled, fails when evaluating depsgraph after copying ID with no main for preview
|
||||
* creation. */
|
||||
// BLI_assert((psys->flag & PSYS_SHARED_CACHES) == 0);
|
||||
psysn->flag |= PSYS_SHARED_CACHES;
|
||||
BLI_assert(psysn->pointcache != NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user