GPUOpen-LibrariesAndSDKs / BlenderUSDHydraAddon

This add-on allows you to assemble and compose USD data with Blender data and render it all using various renderers via Hydra.
Apache License 2.0
362 stars 37 forks source link

Uses cached version on import despite external changes in the model #268

Closed xahon closed 1 year ago

xahon commented 1 year ago
  1. When I import a model in .usda format
  2. Then externally change some parameters and save the file
  3. Remove all object in blender (A + Delete)
  4. Then import the same file again - changes are not reflected in the blender.

If replace 3rd with creating a new blender project (File -> New -> General -> Remove default stuff with A + Delete) and then import, changes are reflected as expected.

Sample model

#usda 1.0
(
    doc = "Blender v3.3.1"
    metersPerUnit = 1
    upAxis = "Z"
)

def Xform "Plane"
{
    matrix4d xformOp:transform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
    uniform token[] xformOpOrder = ["xformOp:transform"]

    def Mesh "Plane"
    {
        int[] faceVertexCounts = [4]
        int[] faceVertexIndices = [0, 1, 3, 2]
        normal3f[] normals = [(0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1)] (
            interpolation = "faceVarying"
        )
        point3f[] points = [(-1, -1, 0), (1, -1, 0), (-1, 1, 0), (1, 1, 0)]
        texCoord2f[] primvars:UVMap = [(0, 0), (1, 0), (1, 1), (0, 1)] (
            interpolation = "faceVarying"
        )
        uniform token subdivisionScheme = "none"
    }
}

Try to do the steps and on step 2 change, for example, point3f[] points = [(-1, -1, 0), (1, -1, 0), (-1, 1, 0), (1, 1, 0)] to point3f[] points = [(-1, -1, 1), (1, -1, 0), (-1, 1, 0), (1, 1, 0)]. Logically the coplanarity of the plane should fade away but the plugin uses previous version (probably due to caching)


Blender 3.3.1 (b29cfe5a936) Built-in version of USD plugin (not shown in the addons list)

xahon commented 1 year ago

I guess that blender now uses built-in version of the USD plugin and this repo is wrong. Main issue is here: https://developer.blender.org/T103276