Blender Git Loki

Git Commits -> Revision 7800864

April 30, 2021, 00:25 (GMT)
Show a bounding box for object assets while dragging

Note: Object assets have to be saved with this commit or later for the bounding
box to appear.

Basic idea is:
* Store the bounding box (and related info) in the asset metadata.
* The bounding box has to be updated and written to custom properties of the
asset metadata.
* There's a new `AssetTypeInfo` struct, to set asset type dependent callbacks
or data (in future). ID types can conveniently define asset-type info as part
of their `IDTypeInfo` definition.
* The asset-type info can contain a custom callback to be executed before the
asset is saved. This is how the object can write its custom asset metadata.
* The dropbox can also register a callback to set properties for its
gizmo-group now. Used to copy
* The "placement plane" gizmo is scaled to the bounding box size too.
* For local ID assets, the data should be accessed directly, so the file
doesn't have to be saved to get the bounding box updated.

Also:
* Added proper gizmo group custom property support to C (was already supported
in Python, or in C with some hacking).
* Store the basis matrix (world matrix without parent or constraint transforms)
in the custom asset metadata. Used by the placement gizmo to scale the
bounding box to match the result visually when dropping.
* The preview image is disabled while dragging objects over the 3D view.
* The bounding box always snaps with its lower edge (Z axis) to the surface.
Snapping with other axes can be added still.
* However, actually dropping the object still uses the origin, so the drop
position may not match what the bounding box indicated. This could be changed
to also use the bounding box instead. Or the drawn bounding box should be
translated to respect the origin position.

Commit Details:

Full Hash: 78008642ae010c64da4cb6b64911b44488823c3e
Parent Commit: 5df6caa
Lines Changed: +414, -29

20 Modified Paths:

/source/blender/blenkernel/BKE_asset.h (+17, -0) (Diff)
/source/blender/blenkernel/BKE_idtype.h (+5, -0) (Diff)
/source/blender/blenkernel/BKE_main.h (+2, -2) (Diff)
/source/blender/blenkernel/intern/asset.cc (+20, -0) (Diff)
/source/blender/blenkernel/intern/object.c (+54, -0) (Diff)
/source/blender/blenloader/intern/readfile.c (+3, -0) (Diff)
/source/blender/editors/asset/asset_edit.cc (+20, -0) (Diff)
/source/blender/editors/include/ED_asset.h (+4, -0) (Diff)
/source/blender/editors/include/UI_interface.h (+2, -0) (Diff)
/source/blender/editors/interface/interface.c (+2, -0) (Diff)
/source/blender/editors/space_file/file_draw.c (+9, -2) (Diff)
/source/blender/editors/space_view3d/space_view3d.c (+46, -3) (Diff)
/source/blender/editors/space_view3d/view3d_placement.c (+119, -9) (Diff)
/source/blender/makesdna/DNA_asset_types.h (+3, -0) (Diff)
/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c (+9, -0) (Diff)
/source/blender/windowmanager/gizmo/WM_gizmo_types.h (+3, -0) (Diff)
/source/blender/windowmanager/intern/wm_dragdrop.c (+69, -3) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+3, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+7, -3) (Diff)
/source/blender/windowmanager/WM_types.h (+17, -7) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021