my apttemts are failing.
Vex:
In vex there aren`t even any prints happening
string @primpath; // Debugging message for variable definition printf("Variables defined."); // Retrieve variants string models[] = usd_variants(0, @primpath, "model"); // Debugging message to check if variants are retrieved printf("Number of variants: %d", len(models)); // Check if at least one variant is available if (len(models) > 0) { // Set the desired variant usd_setvariantselection(0, @primpath, "model", models[1]); // Debugging message for variant selection printf("Variant selection set."); // Apply API to the variant usd_applyapi(0, @primpath, "GeomModelAPI"); // Debugging message for API application printf("API applied."); } else { // Debugging message if no variants are available printf("No variants available."); }
Python:
It seems however that my python script isn`t working.
(ive also tried @TESTING wich didn`t work)
here is my script.
from pxr import UsdGeom
from pxr import UsdGeom try: lopNode = hou.pwd().inputs()[0] stage = lopNode.stage() print(stage) node_base = "/instanced_variants1/Instance" variable_value = hou.node(".").parm("primnr").eval() node_base += str(variable_value) prim = stage.GetPrimAtPath(node_base) testing = prim.GetAttribute("primvars:TESTING").Get() pvAPI = UsdGeom.PrimvarsAPI(prim) primvar = pvAPI.FindPrimvarWithInheritance("TESTING") primvarValue = primvar.ComputeFlattened() return testing except Exception as e: return 2
it returns 0 indicating that it cant find the attrib
although sometimes its all 2.
I`m at a loss here as it seems like this is a good workflow.