The official Blender project repository.
Charles Flèche
0df5d8220b
All checks were successful
buildbot/vdev-code-daily-lint Build done.
buildbot/vdev-code-daily-darwin-x86_64 Build done.
buildbot/vdev-code-daily-linux-x86_64 Build done.
buildbot/vdev-code-daily-windows-amd64 Build done.
buildbot/vdev-code-daily-darwin-arm64 Build done.
buildbot/vdev-code-daily-coordinator Build done.
When importing an USD, the Blender object names do not necessarily match Prim names: ``` #usda 1.0 def Xform "xform1" { def Mesh "MyObject" # Will be imported as "MyObject" } def Xform "xform2" { def Mesh "MyObject" # Will be imported as "MyObject.001" } def Xform "xform2" { def Mesh "MyObject" # Will be imported as "MyObject.002" } ``` This makes it difficult in the [USD Import Hooks] (https://docs.blender.org/api/current/bpy.types.USDHook.html) to link a Blender object back to its source Prim for additional processing. A typical use cases for games is to generate UVs, create and apply a material on the fly when importing a collision shape that does not have a visual representation (hence no materials) based on some Prim attributes, but that the artist needs to differenciate in Blender's viewport. The Import context exposes a new method `get_prim_map()` that returns a `dict` of `prim path` / `list of Blender ID`. For example, given the following USD scene, ``` / |--XformThenCube [def Xform] | `--Cube [def Cube] |--XformThenXformCube [def Xform] | `--XformIntermediate [def Xform] | `--Cube [def Mesh] |--Cube [def Cube] `--Material [def Material] `--Principled_BSDF [def Shader] ``` the `get_prim_map()` method will return a map as: ```python @static_method def on_import(import_context): pprint(import_context.get_prim_map()) ``` ```json { "/Cube": [bpy.data.objects["Cube.002"], bpy.data.meshes["Cube.002"]], "/XformThenCube": [bpy.data.objects["XformThenCube"]], "/XformThenCube/Cube": [bpy.data.objects["Cube"], bpy.data.meshes["Cube"]], "/XformThenXformCube": [bpy.data.objects["XformThenXformCube"]], "/XformThenXformCube/XformIntermediate": [bpy.data.objects["XformIntermediate"]], "/XformThenXformCube/XformIntermediate/Cube": [bpy.data.objects["Cube.001"], bpy.data.meshes["Cube.001"]], "/Material": [bpy.data.materials["Material"]], } ``` Co-authored-by: Odréanne Breton <odreanne.breton@ubisoft.com> Co-authored-by: Sttevan Carnali Joga <sttevan.carnali-joga@ubisoft.com> Co-authored-by: Charles Flèche <charles.fleche@ubisoft.com> |
||
---|---|---|
.gitea | ||
.github | ||
build_files | ||
doc | ||
extern | ||
intern | ||
lib | ||
locale | ||
release | ||
scripts | ||
source | ||
tests | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitignore | ||
.gitmodules | ||
AUTHORS | ||
CMakeLists.txt | ||
COPYING | ||
GNUmakefile | ||
make.bat | ||
pyproject.toml | ||
README.md |
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.
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.