OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Setting up Model Cards textures can hang HdStorm/USDVIEW

Open deboisj opened this issue 1 year ago • 1 comments

Description of Issue

Setting up Model Card textures on point instances can cause hdStorm / usdview to hang. See repro steps bellow.

Breaking while it hangs it is looping here : https://github.com/PixarAnimationStudios/OpenUSD/blob/dev/pxr/imaging/hdSt/mesh.cpp#L366

I think numInstanceLevels is initialized to 0.... so -1 and it being a size_t/unsigned...it starts looping at the max value... it would probably end eventually...but....going to be a while!

Steps to Reproduce

Using this USDA file with a simple point instancer with draw modes / cards :

#usda 1.0
(
    endTimeCode = 1
    startTimeCode = 0
)


def Xform "Comp" (
	apiSchemas = ["GeomModelAPI"]
	kind = "assembly"
)
{
	def PointInstancer "Instancer" (
		kind = "assembly"
	)
	{
		point3f[] positions = [(0, 0, 0), (4, 4, 4)]
		int[] protoIndices.timeSamples = {
			0: [1, 1],
		}
		rel prototypes = [
			</Comp/Instancer/Protos/Proto1>,
			</Comp/Instancer/Protos/Proto2>,
		]

		def "Protos" (
			kind = "assembly"
		)
		{
			def Xform "Proto1" (
				apiSchemas = ["GeomModelAPI"]
				kind = "component"
			)
			{
				uniform token model:cardGeometry = "cross"
				uniform token model:drawMode = "cards"
				token visibility = "visible"

				def Cube "cube"
				{
					color3f[] primvars:displayColor = [(1, 0, 0)]
				}
			}

			def Xform "Proto2" (
				apiSchemas = ["GeomModelAPI"]
				kind = "component"
			)
			{
				uniform token model:cardGeometry = "cross"
				uniform token model:drawMode = "cards"
				token visibility = "visible"

				def Cone "cone"
				{
					color3f[] primvars:displayColor = [(0, 1, 0)]
				}
			}
		}
	}
}

From the interpreter in USDVIEW, run this :

p = usdviewApi.stage.GetPrimAtPath("/Comp/Instancer/Protos/Proto2") m = UsdGeom.ModelAPI.Apply(p) m.CreateModelCardTextureXPosAttr().Set("D:\\Models\\USD\\uvgrid.jpg") m.CreateModelCardTextureYPosAttr().Set("D:\\Models\\USD\\uvgrid.jpg")

image

System Information (OS, Hardware)

Windows

Package Versions

0.24.05

deboisj avatar Aug 16 '24 20:08 deboisj

Filed as internal issue #USD-9998

jesschimein avatar Aug 19 '24 17:08 jesschimein