DFGBindingWrapper and RTvals

Hello guys. I'm trying to run a canvas file in KL using the DFGBindingWrapper, but it requires RTval type to set up arguments. Is it possible to convert KL types to RTval in KL? All info I can find in the docs refers to the Python and C++ languages.

Thanks!

Comments

  • MaxMax Fabric for Houdini Posts: 5

    Hi,

    you can cast them directly.
    Here is an example using the relaxOnSurface preset:

      String relaxOnSurfacePath = "FabricEngine/2.3.0/Presets/DFG/Fabric/Compounds/Deform/RelaxOnSurfaceVec3.canvas";
    
          DFGBindingWrapper relaxOnSurfaceNode(relaxOnSurfacePath);
          RTVal inputs[String];
    
          inputs["mesh"] = RTVal(myMesh);
          inputs["positions"] = RTVal(myPositions);
          inputs["iterations"] = RTVal(myIterations);
    
          RTVal outputs[String];
          String errors;
          Boolean res = relaxOnSurfaceNode.executeWithArgs(inputs, outputs, errors);
    
          if(!res)
          {
            report("relaxOnSurface ERROR : " + errors);
            return;
          }
    
          Vec3 relaxedPoints[];
          relaxedPoints = outputs.get("result", RTVal(relaxedPoints));
    

    hope this help.

    Max

  • Gustavo BoehsGustavo Boehs Posts: 63 ✭✭

    Thanks! This helped a lot :)

Sign In or Register to comment.