1
1
This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Julian Eisel 8925d3b7bf UI/Assets: Initial Asset View UI template
The asset view UI template is a mini-version of the Asset Browser that
can be placed in regular layouts, regions or popups. At this point it's
made specifically for placement in vertical layouts, it can be made more
flexible in the future.
Generally the way this is implemented will likely change a lot still as
the asset system evolves.

The Pose Library add-on will use the asset view to display pose
libraries in the 3D View sidebar.

References:
* https://developer.blender.org/T86139
* https://code.blender.org/2021/06/asset-browser-project-update/#what-are-we-building
* https://code.blender.org/2021/05/pose-library-v2-0/#use-from-3d-viewport

Notes:
* Important limitation: Due to the early & WIP implementation of the
  asset list, all asset views showing the same library will show the
  same assets. That is despite the ID type filter option the template
  provides. The first asset view created will determine what's visible.
  Of course this should be made to work eventually.
* The template supports passing an activate and a drag operator name.
  The former is called when an asset is clicked on (e.g. to apply the
  asset) the latter when dragging (e.g. to .blend a pose asset). If no
  drag operator is set, regular asset drag & drop will be executed.
* The template returns the properties for both operators (see example
  below).
* The argument list for using the template is quite long, but we can't
  avoid that currently. The UI list design requires that we pass a
  number of RNA or custom properties to work with, that for the Pose
  Libraries should be registered at the Pose Library add-on level, not
  in core Blender.
* Idea is that Python scripts or add-ons that want to use the asset view
  can register custom properties, to hold data like the list of assets,
  and the active asset index. Maybe that will change in future and we
  can manage these internally.

As an example, the pose library add-on uses it like this:
```
activate_op_props, drag_op_props = layout.template_asset_view(
    "pose_assets",
    workspace,
    "active_asset_library",
    wm,
    "pose_assets",
    workspace,
    "active_pose_asset_index",
    filter_id_types={"filter_action"},
    activate_operator="poselib.apply_pose_asset",
    drag_operator="poselib.blend_pose_asset",
)
drag_op_props.release_confirm = True
drag_op_props.flipped = wm.poselib_flipped
activate_op_props.flipped = wm.poselib_flipped
```
2021-07-15 16:12:36 +02:00
2021-07-06 12:05:27 +10:00
2021-03-26 16:15:02 +01:00
2010-10-13 14:44:22 +00:00

Sphinx Warnings

: WARNING: Could not obtain image size. :scale: option is ignored.

Note the preview is not accurate and warnings may not indicate real issues.

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

https://projects.blender.org/archive/blender-archive/media/commit/8925d3b7bf989e1db364d989fbd0c6cdb9a2acdb/https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
Archive of Blender with old branches
Readme 823 MiB
Languages
C 67.4%
C++ 23.4%
Python 6.1%
CMake 1.5%
GLSL 1.1%
Other 0.4%