Nodes/Pixar's OpenUSD/Create USD Vec2
ComfyUI Node

Create USD Vec2

A typed 2D value for USD attributes

By cjhosken·Created 3 months ago·Updated 2 months ago· 9
Create USD Vec2
    • vec2
    x0.00
    y0.00
    vec2_typefloat2

    This is a plumbing node, and it owns that label proudly. USD attributes don't hold "a number" - they hold typed values, and a 2D vector in USD is not the same thing as a 2D vector in the ComfyUI primitive world. Create USD Vec2 is how you build a proper typed Vec2 value (or TexCoord2, or Int2…) that the pack's attribute-setting nodes can actually write into a stage.

    You'll reach for it when you're working at the attribute level - the territory of Get/Set USD Attribute and the scripting node. If you're setting a primvars UV on a mesh or a clippingRange on a camera, those are float2/texCoord2 attributes, and this is the node that manufactures the value with the right type so SetUSDAttribute doesn't choke on it. If you never touch raw attributes, you'll probably never touch this node - and that's fine.

    The inputs

    • x, y - the two floats. Defaults to 0,0.
    • vec2_type - the type label, default float2. The dropdown covers float2, double2, int2, half2, and the texture-coordinate trio texCoord2f, texCoord2d, texCoord2h. Pick texCoord2* when the value is a UV; pick float2 for anything else. The choice matters because the type is part of the attribute's identity in USD - a float2 and a texCoord2f are different attribute types even if the numbers match.

    Output is a single VEC2 socket carrying the typed value - wire it into the value input of the pack's attribute nodes.

    Install & the honest caveats

    Pack install, one time: ComfyUI Manager → search "ComfyUI-OpenUSD", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/cjhosken/ComfyUI-OpenUSD
    

    then restart. Deps: usd-core==26.5, numpy==2.5.0, trimesh.

    Honest caveats: the VEC2 output socket is this pack's type, so it only plugs into consumers that expect it - mostly the pack's own attribute/scripting nodes. And note that the half-precision options (half2, texCoord2h) are stored as plain float tuples in the pack rather than native half types - USD will happily take them, but it's worth knowing the pack treats half as "float that we label half." For a value node this is a minor detail; just don't assume half2 buys you memory savings.

    Category3d/usd/type

    Inputs (3)

    NameTypeDefaultDescription
    xFLOAT0.00
    yFLOAT0.00
    vec2_typeCOMBOfloat27 options: float2, double2, int2, half2, texCoord2f, texCoord2d, +1

    Outputs (1)

    NameTypeDescription
    vec2VEC2