Blender Git Loki

Git Commits -> Revision 4b03966

Revision 4b03966 by Julian Eisel (master)
December 14, 2020, 12:17 (GMT)
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 (812ea9184221).

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

Commit Details:

Full Hash: 4b0396695c622d1ac8669600fa820e80b1f0979f
Parent Commit: 732d0b4
Lines Changed: +255, -77

5 Modified Paths:

/source/blender/blenkernel/intern/object.c (+3, -1) (Diff)
/source/blender/editors/include/ED_view3d.h (+5, -0) (Diff)
/source/blender/editors/render/render_preview.c (+209, -51) (Diff)
/source/blender/editors/space_view3d/view3d_utils.c (+35, -0) (Diff)
/source/blender/editors/space_view3d/view3d_view.c (+3, -25) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021