file_path
stringlengths 21
224
| content
stringlengths 0
80.8M
|
---|---|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnRenderPostprocessEntry.ogn | {
"RenderPostProcessEntry": {
"version": 1,
"description": [ "Entry point for RTX Renderer Postprocessing" ],
"metadata": {
"uiName": "Render Postprocess Entry",
"hidden": "true"
},
"categories": "internal",
"inputs": {
"sourceName": {
"type": "string",
"description": "Source name of the AOV",
"default": "ldrColor"
}
},
"outputs": {
"cudaMipmappedArray": {
"type": "uint64",
"description": "Pointer to the CUDA Mipmapped Array",
"metadata": {
"uiName": "cudaMipmappedArray"
}
},
"width": {
"type": "uint",
"description": "Width",
"metadata": {
"uiName": "width"
}
},
"height": {
"type": "uint",
"description": "Height",
"metadata": {
"uiName": "height"
}
},
"mipCount": {
"type": "uint",
"description": "Mip Count",
"metadata": {
"uiName": "mipCount"
}
},
"format": {
"type": "uint64",
"description": "Format",
"metadata": {
"uiName": "format"
}
},
"simTime": {
"type": "double",
"description": "Simulation time",
"metadata": {
"uiName": "simTime"
}
},
"hydraTime": {
"type": "double",
"description": "Hydra time in stage",
"metadata": {
"uiName": "hydraTime"
}
},
"stream": {
"type": "uint64",
"description": "Pointer to the CUDA Stream",
"metadata": {
"uiName": "stream"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnRemoveAttr.ogn | {
"RemoveAttribute": {
"version": 2,
"description": ["Copies all attributes from an input bundle to the output bundle, except for any specified to be removed."],
"metadata": {
"uiName": "Remove Attributes From Bundles"
},
"categories": ["bundle"],
"inputs": {
"attrNamesToRemove": {
"type": "token",
"description": [
"A list of wildcard patterns used to match the attribute names that are to be removed from the output bundle",
"",
"Supported syntax of wildcard pattern:",
" '*' - match an arbitrary number of any characters",
" '?' - match any single character",
" '^' - (caret) is used to define a pattern that is to be excluded",
"",
"Example of wildcard patterns, input: ['points', 'faceVertexCount', 'faceVertexIndices', 'size']",
" '*' - match any",
" '* ^points' - match any, but exclude 'points'",
" '* ^face*' - match any, but exclude 'faceVertexCount' and 'faceVertexIndices'"
],
"default": "",
"metadata": {
"uiName": "Attributes To Remove"
}
},
"allowRemovePrimInternal": {
"type": "bool",
"default": false,
"description": "When on, then primitive internal attributes can be removed('sourcePrimPath' etc...)",
"metadata": {
"uiName": "Allow Remove Prim Internal"
}
},
"data": {
"type": "bundle",
"description": "Collection of attributes to be partially copied to the output",
"metadata": {
"uiName": "Original Bundle"
}
}
},
"outputs": {
"data": {
"type": "bundle",
"description": ["Final bundle of attributes, with the attributes specified by attrNamesToRemove omitted"],
"metadata": {
"uiName": "Bundle After Removal"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGpuInteropRenderProductEntry.ogn | {
"GpuInteropRenderProductEntry": {
"version": 1,
"description": [ "Entry node for post-processing hydra render results for a single view " ],
"metadata": {"hidden": "true"},
"categories": "internal",
"scheduling": ["threadsafe"],
"inputs": {
},
"outputs": {
"simTime": {
"type": "double",
"description": "Simulation time",
"metadata": {
"uiName": "simTime"
}
},
"hydraTime": {
"type": "double",
"description": "Hydra time in stage",
"metadata": {
"uiName": "hydraTime"
}
},
"gpu": {
"type": "uint64",
"description": "Pointer to shared context containing gpu foundations",
"metadata": {
"uiName": "gpuFoundations"
}
},
"rp": {
"type": "uint64",
"description": "Pointer to render product for this view",
"metadata": {
"uiName": "renderProduct"
}
},
"exec": {
"type": "execution",
"description": "Trigger for scheduling dependencies"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadPrimsV2.ogn | {
"ReadPrimsV2": {
"version": 1,
"description": [
"Reads primitives and outputs multiple primitive in a bundle."
],
"uiName": "Read Prims",
"scheduling": [ "usd-read" ],
"categories": [ "sceneGraph", "bundle" ],
"inputs": {
"prims": {
"uiName": "Prims",
"type": "target",
"description": [
"The root prim(s) that pattern matching uses to search from.",
"If 'pathPattern' input is empty, the directly connected prims will be read.",
"Otherwise, all the subtree (including root) will be tested against pattern matcher inputs,",
"and the matched prims will be read into the output bundle.",
"If no prims are connected, and 'pathPattern' is none empty, absolute root \"/\" will be searched as root prim."
],
"metadata": {
"allowMultiInputs": "1"
}
},
"pathPattern": {
"uiName": "Prim Path Pattern",
"type": "string",
"default": "",
"description": [
"A list of wildcard patterns used to match the prim paths that are to be imported",
"",
"Supported syntax of wildcard pattern:",
" '*' - match an arbitrary number of any characters",
" '?' - match any single character",
" '^' - (caret) is used to define a pattern that is to be excluded",
"",
"Example of wildcard patterns, input: ['/Cube0', '/Cube1', '/Box']",
" '*' - match any",
" '* ^/Box' - match any, but exclude '/Box'",
" '* ^/Cube*' - match any, but exclude '/Cube0' and '/Cube1'"
]
},
"typePattern": {
"uiName": "Prim Type Pattern",
"type": "string",
"default": "*",
"description": [
"A list of wildcard patterns used to match the prim types that are to be imported",
"",
"Supported syntax of wildcard pattern:",
" '*' - match an arbitrary number of any characters",
" '?' - match any single character",
" '^' - (caret) is used to define a pattern that is to be excluded",
"",
"Example of wildcard patterns, input: ['Mesh', 'Cone', 'Cube']",
" '*' - match any",
" '* ^Mesh' - match any, but exclude 'Mesh'",
" '* ^Cone ^Cube' - match any, but exclude 'Cone' and 'Cube'"
]
},
"attrNamesToImport": {
"uiName": "Attribute Name Pattern",
"type": "string",
"default": "*",
"description": [
"A list of wildcard patterns used to match the attribute names that are to be imported",
"",
"Supported syntax of wildcard pattern:",
" '*' - match an arbitrary number of any characters",
" '?' - match any single character",
" '^' - (caret) is used to define a pattern that is to be excluded",
"",
"Example of wildcard patterns, input: ['points', 'faceVertexCount', 'faceVertexIndices', 'size']",
" '*' - match any",
" '* ^points' - match any, but exclude 'points'",
" '* ^face*' - match any, but exclude 'faceVertexCount' and 'faceVertexIndices'"
]
},
"usdTimecode": {
"uiName": "Time",
"type": "timecode",
"default": "NaN",
"description": "The time at which to evaluate the transform of the USD prim. A value of \"NaN\" indicates that the default USD time stamp should be used"
},
"computeBoundingBox": {
"uiName": "Compute Bounding Box",
"type": "bool",
"default": false,
"description": "For each primitive compute local bounding box and store them as 'bboxMinCorner', 'bboxMaxCorner' and 'bboxTransform' attributes."
},
"applySkelBinding": {
"uiName": "Apply Skel Binding",
"type": "bool",
"default": false,
"description": [
"If an input USD prim is skinnable and has the SkelBindingAPI schema applied, read skeletal data and apply SkelBinding to deform the prim.",
"The output bundle will have additional child bundles created to hold data for the skeleton and skel animation prims if present. After",
"evaluation, deformed points and normals will be written to the `points` and `normals` attributes, while non-deformed points and normals",
"will be copied to the `points:default` and `normals:default` attributes."
]
},
"enableChangeTracking": {
"uiName": "USD change tracking",
"type": "bool",
"default": true,
"description": [
"Should the output bundles only be updated when the associated USD prims change?",
"This uses a USD notice handler, and has a small overhead,",
"so if you know that the imported USD prims will change frequently,",
"you might want to disable this."
]
},
"enableBundleChangeTracking": {
"uiName": "Bundle change tracking",
"type": "bool",
"default": false,
"description": [
"Enable change tracking for output bundle, its children and attributes.",
"The change tracking system for bundles has some overhead, but enables",
"users to inspect the changes that occurred in a bundle.",
"Through inspecting the type of changes user can mitigate excessive computations."
]
},
"_debugStamp": {
"metadata": {
"literalOnly": "1",
"hidden": "true"
},
"type": "int",
"default": 0,
"description": [
"For internal testing only, and subject to change. Please do not depend on this attribute!",
"When not zero, this _debugStamp attribute will be copied to root and child bundles that change",
"When a full update is performed, the negative _debugStamp is written.",
"When only derived attributes (like bounding boxes and world matrices) are updated, _debugStamp + 1000000 is written"
]
}
},
"outputs": {
"primsBundle": {
"type": "bundle",
"description": [
"An output bundle containing multiple prims as children.",
"Each child contains data attributes and two additional token attributes named sourcePrimPath and sourcePrimType",
"which contains the path of the Prim being read"
]
}
},
"state": {
"pathPattern": {
"type": "string",
"description": "State from previous evaluation"
},
"typePattern": {
"type": "string",
"description": "State from previous evaluation"
},
"attrNamesToImport": {
"type": "string",
"description": "State from previous evaluation"
},
"usdTimecode": {
"type": "timecode",
"default": -1,
"description": "State from previous evaluation"
},
"computeBoundingBox": {
"type": "bool",
"default": false,
"description": "State from previous evaluation"
},
"applySkelBinding": {
"type": "bool",
"default": false,
"description": "State from previous evaluation"
},
"enableChangeTracking": {
"type": "bool",
"default": false,
"description": "State from previous evaluation"
},
"enableBundleChangeTracking": {
"type": "bool",
"default": false,
"description": "State from previous evaluation"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnWriteVariable.ogn | {
"omni.graph.core.WriteVariable": {
"version": 2,
"description": [ "Node that writes a value to a variable" ],
"uiName": "Write Variable",
"metadata": { "hidden": "true" },
"categories": [ "internal" ],
"scheduling": ["usd-write"],
"inputs": {
"execIn": {
"type": "execution",
"description": "Input execution state"
},
"variableName": {
"type": "token",
"description": "The name of the graph variable to use.",
"metadata": {
"hidden": "true",
"literalOnly": "1"
}
},
"value": {
"type": "any",
"description": "The new value to be written"
},
"targetPath": {
"type": "token",
"description": "Ignored. Do not use.",
"optional": true,
"metadata": { "hidden": "true" }
},
"graph": {
"type": "target",
"description": "Ignored. Do not use",
"optional": true,
"metadata": { "hidden": "true" }
}
},
"outputs": {
"execOut": {
"type": "execution",
"description": "Output execution"
},
"value": {
"type": "any",
"description": "The written variable value"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnExtractPrim.cpp | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include "OgnExtractPrimDatabase.h"
#include "ReadPrimCommon.h"
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnExtractPrim
{
public:
// Copies attributes from an input bundle to attributes directly on the node
static bool compute(OgnExtractPrimDatabase& db)
{
auto& contextObj = db.abi_context();
auto& nodeObj = db.abi_node();
auto const& inputPrims = db.inputs.prims();
// The computation should only be performed when input bundle or prim or prim path changes.
// At this moment, unfortunately, there is no way to find out if incoming bundle has changed.
// That means we have to recompute all the time.
// Extracting bundles is a O(n) operation in worse case. If the number of children in the input bundle
// is substantial, then we can get significant performance slow down.
// When Dirty IDs interface is in place, this function should be updated to recompute only
// when input bundle, or prim path is out of date.
// Suggestion: an internal cache - a map of path to child bundle handle could be sufficient.
ConstBundleHandle extractedHandle{ ConstBundleHandle::invalidValue() };
if(db.inputs.prim().size() == 0)
{
// extract child bundle using input prim path
std::string const pathStr{ db.inputs.primPath() };
if (PXR_NS::SdfPath::IsValidPathString(pathStr))
{
auto primPath = omni::fabric::asInt(PXR_NS::TfToken(pathStr.data()));
extractedHandle = extractPrimByPath(contextObj, inputPrims, primPath);
}
}
else
{
if(db.inputs.prim().size() > 1)
db.logWarning("Only one prim target is supported, the rest will be ignored");
extractedHandle = extractPrimByPath(contextObj, inputPrims, db.pathToToken(db.inputs.prim()[0]));
}
// update outputs
BundleType extractedBundle(contextObj, extractedHandle);
db.outputs.primBundle() = extractedBundle;
return extractedBundle.isValid();
}
};
REGISTER_OGN_NODE()
} // nodes
} // graph
} // omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadPrimMaterial.ogn | {
"ReadPrimMaterial": {
"version": 2,
"description": [
"Given a path to a prim on the current USD stage,",
" outputs the material of the prim. Gives an error if the given prim",
" can not be found."
],
"uiName": "Read Prim Material",
"categories": [ "sceneGraph" ],
"scheduling": [ "usd-read", "threadsafe" ],
"exclude": [ "tests" ],
"inputs": {
"primPath": {
"type": "path",
"description": "Path of the prim with the material to be read.",
"uiName": "Prim Path",
"deprecated": "Use prim input instead"
},
"prim": {
"type": "target",
"description": "The prim with the material to be read. If both this and primPath inputs are set, this input takes priority."
}
},
"outputs": {
"material": {
"uiName": "Material Path",
"type": "path",
"description": "The material of the input prim",
"deprecated": "Use materialPrim output instead"
},
"materialPrim": {
"uiName": "Material",
"type": "target",
"description": "The prim containing the material of the input prim"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadPrim.cpp | // Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
/*
_____ ______ _____ _____ ______ _____ _______ ______ _____
| __ \ | ____|| __ \ | __ \ | ____|/ ____| /\ |__ __|| ____|| __ \
| | | || |__ | |__) || |__) || |__ | | / \ | | | |__ | | | |
| | | || __| | ___/ | _ / | __| | | / /\ \ | | | __| | | | |
| |__| || |____ | | | | \ \ | |____| |____ / ____ \ | | | |____ | |__| |
|_____/ |______||_| |_| \_\|______|\_____|/_/ \_\|_| |______||_____/
ReadPrim is deprecated and should not be used.
First version of ReadPrim outputs 'Single Primitive in a Bundle'(SPiB) + Dynamic Attributes(DA).
The successor ReadPrims outputs 'Multiple Primitives in a Bundle'(MPiB) with no dynamic attributes.
This operator is kept for backward compatibility.
*/
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include "OgnReadPrimDatabase.h"
#include "PrimCommon.h"
#include "ReadPrimCommon.h"
#include <omni/kit/commands/ICommandBridge.h>
#include <carb/dictionary/DictionaryUtils.h>
#include <omni/fabric/FabricUSD.h>
#include <omni/kit/PythonInterOpHelper.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnReadPrim
{
std::unordered_set<NameToken> m_added;
public:
// ----------------------------------------------------------------------------
static void initialize(const GraphContextObj& context, const NodeObj& nodeObj)
{
char const* primNodePath = nodeObj.iNode->getPrimPath(nodeObj);
CARB_LOG_WARN("ReadPrim node is deprecated: %s, use ReadPrimAttributes instead", primNodePath);
// When inputs:bundle is not an optional input, the outputs need to be cleared when they are disconnected.
AttributeObj inputBundleAttribObj =
nodeObj.iNode->getAttributeByToken(nodeObj, OgnReadPrimAttributes::inputs::prim.m_token);
inputBundleAttribObj.iAttribute->registerValueChangedCallback(
inputBundleAttribObj, onInputBundleValueChanged, true);
}
// ----------------------------------------------------------------------------
static void onInputBundleValueChanged(AttributeObj const& inputBundleAttribObj, void const* userData)
{
NodeObj nodeObj = inputBundleAttribObj.iAttribute->getNode(inputBundleAttribObj);
GraphObj graphObj = nodeObj.iNode->getGraph(nodeObj);
// If the graph is currently disabled then delay the update until the next compute.
// Arguably this should be done at the message propagation layer, then this wouldn't be necessary.
if (graphObj.iGraph->isDisabled(graphObj))
{
return;
}
// clear the output bundles
GraphContextObj context = graphObj.iGraph->getDefaultGraphContext(graphObj);
auto outputTokens = { OgnReadPrimAttributes::outputs::primBundle.m_token };
for (auto& outputToken : outputTokens)
{
BundleHandle outBundle = context.iContext->getOutputBundle(
context, nodeObj.nodeContextHandle, outputToken, kAccordingToContextIndex);
context.iContext->clearBundleContents(context, outBundle);
}
}
// ----------------------------------------------------------------------------
static PathC getPath(OgnReadPrimDatabase& db)
{
return readPrimBundle_getPath(db.abi_context(), db.abi_node(), OgnReadPrimAttributes::inputs::prim.m_token,
false, omni::fabric::kUninitializedToken, db.getInstanceIndex());
}
// ----------------------------------------------------------------------------
static bool writeToBundle(OgnReadPrimDatabase& db, PathC inputPath, bool force, pxr::UsdTimeCode const& time)
{
return readPrimBundle_writeToBundle(db.abi_context(), db.abi_node(), inputPath, db.inputs.attrNamesToImport(),
db.outputs.primBundle(), force, db.inputs.computeBoundingBox(), time, db.getInstanceIndex());
}
// ----------------------------------------------------------------------------
static void clean(OgnReadPrimDatabase& db)
{
db.outputs.primBundle().clear();
// remove dynamic attributes
BundleType empty;
updateAttributes(db.abi_context(), db.abi_node(), empty, db.getInstanceIndex());
}
// ----------------------------------------------------------------------------
static void updateAttributes(GraphContextObj const& contextObj,
NodeObj const& nodeObj,
BundleType const& bundle,
InstanceIndex instIdx)
{
OgnReadPrim& state = OgnReadPrimDatabase::sInternalState<OgnReadPrim>(nodeObj);
omni::kit::commands::ICommandBridge::ScopedUndoGroup scopedUndoGroup;
extractBundle_reflectBundleDynamicAttributes(nodeObj, contextObj, bundle, state.m_added, instIdx);
}
// ----------------------------------------------------------------------------
static bool compute(OgnReadPrimDatabase& db)
{
// import by pattern
bool inputChanged = false;
// bounding box changed
if (db.state.computeBoundingBox() != db.inputs.computeBoundingBox())
{
db.state.computeBoundingBox() = db.inputs.computeBoundingBox();
inputChanged = true;
}
// attribute filter changed
NameToken const attrNamesToImport = db.inputs.attrNamesToImport();
if (db.state.attrNamesToImport() != attrNamesToImport.token)
{
db.state.attrNamesToImport() = attrNamesToImport.token;
inputChanged = true;
}
// compute
bool result = readPrimBundle_compute<OgnReadPrim>(db, inputChanged);
if (!result)
return false;
// update dynamic attributes
BundleType outputBundle(db.abi_context(), db.outputs.primBundle().abi_bundleHandle());
updateAttributes(db.abi_context(), db.abi_node(), outputBundle, db.getInstanceIndex());
return outputBundle.isValid();
}
static bool updateNodeVersion(GraphContextObj const& context, NodeObj const& nodeObj, int oldVersion, int newVersion)
{
if (oldVersion < newVersion)
{
bool upgraded = false;
if (oldVersion < 6)
{
// backward compatibility: `inputs:attrNamesToImport`
// Prior to this version `inputs:attrNamesToImport` attribute did not support wild cards.
// The meaning of an empty string was to include all attributes. With the introduction of the wild cards
// we need to convert an empty string to "*" in order to include all attributes.
static Token const value{ "*" };
if (nodeObj.iNode->getAttributeExists(nodeObj, "inputs:attrNamesToImport"))
{
AttributeObj attr = nodeObj.iNode->getAttribute(nodeObj, "inputs:attrNamesToImport");
auto roHandle = attr.iAttribute->getAttributeDataHandle(attr, kAccordingToContextIndex);
Token const* roValue = getDataR<Token const>(context, roHandle);
if (roValue && roValue->getString().empty())
{
Token* rwValue =
getDataW<Token>(context, attr.iAttribute->getAttributeDataHandle(attr, kAccordingToContextIndex));
*rwValue = value;
}
}
else
{
nodeObj.iNode->createAttribute(nodeObj, "inputs:attrNamesToImport", Type(BaseDataType::eToken),
&value, nullptr, kAttributePortType_Input,
kExtendedAttributeType_Regular, nullptr);
}
upgraded = true;
}
if (oldVersion < 8)
{
upgraded |= upgradeUsdTimeCodeInput(context, nodeObj);
}
return upgraded;
}
return false;
}
};
REGISTER_OGN_NODE()
} // namespace nodes
} // namespace graph
} // namespace omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGpuInteropRenderProductEntry.cpp | // Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include "OgnGpuInteropRenderProductEntryDatabase.h"
#include <omni/graph/core/NodeTypeRegistrar.h>
#include <omni/graph/core/GpuInteropEntryUserData.h>
#include <omni/graph/core/iComputeGraph.h>
namespace omni
{
namespace graph
{
namespace core
{
// Replaces depreciated GpuInteropRenderProductEntry
// Downstream nodes of OgnGpuInteropRenderProductEntry can write Cuda code directly and they will be scheduled on the
// Gpu Foundations Rendergraph for Device 0. GpuInteropCudaEntry passes the cuda buffer pointer and
// associated metadata for a specific named resource outputted by the Rtx Renderer (such as LdrColor for
// final color). This buffer is a read/write buffer, and changes will be passed to consumer of the renderer's
// output
class OgnGpuInteropRenderProductEntry
{
public:
static bool compute(OgnGpuInteropRenderProductEntryDatabase& db)
{
GpuInteropRpEntryUserData* userData = static_cast<GpuInteropRpEntryUserData*>(db.abi_node().iNode->getUserData(db.abi_node()));
if (!userData)
return false;
db.outputs.simTime() = userData->simTime;
db.outputs.hydraTime() = userData->hydraTime;
db.outputs.rp() = (uint64_t)userData->rp;
db.outputs.gpu() = (uint64_t)userData->gpu;
db.outputs.exec() = ExecutionAttributeState::kExecutionAttributeStateEnabled;
return true;
}
static void initializeType(const NodeTypeObj& nodeTypeObj)
{
OgnGpuInteropRenderProductEntryDatabase::initializeType(nodeTypeObj);
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnRenameAttr.cpp | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include "OgnRenameAttrDatabase.h"
#include "TokenUtils.h"
#include <algorithm>
#include <string>
#include <unordered_map>
#include <vector>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnRenameAttr
{
public:
// Changes the names of attributes from an input prim for the corresponding output prim.
// Attributes not renamed will be copied from the input prim to the output prim without changing the name.
static bool compute(OgnRenameAttrDatabase& db)
{
const auto& inputBundle = db.inputs.data();
auto& outputBundle = db.outputs.data();
// Find all of the attribute names for selection.
std::vector<NameToken> inputAttrNames;
std::vector<NameToken> outputAttrNames;
TokenHelper::splitNames(db.tokenToString(db.inputs.inputAttrNames()), inputAttrNames);
TokenHelper::splitNames(db.tokenToString(db.inputs.outputAttrNames()), outputAttrNames);
size_t nameCount = std::min(inputAttrNames.size(), outputAttrNames.size());
if (nameCount == 0)
{
// No renaming, so we can just copy the input data into the output.
outputBundle = inputBundle;
return true;
}
// Mismatched name sizes are dealt with going with the minimum number, and reporting this warning
if (inputAttrNames.size() != outputAttrNames.size())
{
db.logWarning("Input name size %zu != output name size %zu", inputAttrNames.size(), outputAttrNames.size());
// Reduce the size of the name arrays to make them easier to look up later
inputAttrNames.resize(nameCount);
outputAttrNames.resize(nameCount);
}
// Zip them together so that iterators can be used to find matches
std::unordered_map<NameToken, NameToken> attrNameMap;
std::transform(inputAttrNames.begin(), inputAttrNames.end(), outputAttrNames.begin(),
std::inserter(attrNameMap, attrNameMap.end()),
[](NameToken a, NameToken b) { return std::make_pair(a, b); });
// Start from an empty output prim.
outputBundle.clear();
// Loop through the attributes on the input bundle, adding them to the output and renaming if they appear
// on the list.
for (const auto& input : inputBundle)
{
CARB_ASSERT(input.isValid());
auto newName = input.name();
// If the attribute's name is in the renaming list then rename it
auto itNameFound = attrNameMap.find(input.name());
if (itNameFound != attrNameMap.end())
{
newName = itNameFound->second;
}
outputBundle.insertAttribute(input, newName);
}
return true;
}
};
REGISTER_OGN_NODE()
} // nodes
} // graph
} // omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnExtractPrim.ogn | {
"ExtractPrim": {
"version": 1,
"description": [
"Extract a child bundle that contains a primitive with requested path/prim.",
"This node is designed to work with Multiple Primitives in a Bundle. It searches for a child bundle in the input bundle,",
"with 'sourcePrimPath' that matches 'inputs:prim' or 'inputs:primPath'. The found child bundle will be provided to 'outputs_primBundle', or invalid,",
"bundle otherwise."
],
"uiName": "Extract Prim",
"categories": [ "bundle" ],
"inputs": {
"prims": {
"uiName": "Prims Bundle",
"type": "bundle",
"description": "The Multiple Primitives in Bundle to extract from."
},
"primPath": {
"uiName": "Prim Path",
"type": "path",
"description": "The path of the prim to be extracted from Multiple Primitives in Bundle.",
"deprecated": "Use prim input instead"
},
"prim": {
"type": "target",
"description": "The prim to be extracted from Multiple Primitives in Bundle."
}
},
"outputs": {
"primBundle": {
"type": "bundle",
"description": [
"The extracted Single Primitive in Bundle"
]
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnRenderPreprocessEntry.cpp | // Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include "OgnRenderPreprocessEntryDatabase.h"
#include <omni/graph/core/NodeTypeRegistrar.h>
#include <omni/graph/core/GpuInteropEntryUserData.h>
#include <omni/graph/core/iComputeGraph.h>
namespace omni
{
namespace graph
{
namespace core
{
// OmniGraph nodes executed as a render preprocess need to be connected downstream of an entry point node
// in order to be scheduled as part of the render graph.
// Scheduling of cuda interop nodes begins with one of these entry nodes, which passes data (e.g. a cuda stream
// identifier) to downstream nodes.
class OgnRenderPreprocessEntry
{
public:
static bool compute(OgnRenderPreprocessEntryDatabase& db)
{
CARB_PROFILE_ZONE(1, "OgnRenderPreprocessEntry::compute");
GpuInteropCudaEntryUserData* userData = static_cast<GpuInteropCudaEntryUserData*>(db.abi_node().iNode->getUserData(db.abi_node()));
if (!userData)
return false;
db.outputs.stream() = (uint64_t)userData->cudaStream;
db.outputs.simTime() = userData->simTime;
db.outputs.hydraTime() = userData->hydraTime;
return true;
}
static void initializeType(const NodeTypeObj& nodeTypeObj)
{
OgnRenderPreprocessEntryDatabase::initializeType(nodeTypeObj);
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnRemoveAttr.cpp | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include "OgnRemoveAttrDatabase.h"
#include "TokenUtils.h"
#include "PrimCommon.h"
#include <algorithm>
#include <unordered_set>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnRemoveAttr
{
public:
// Copies all attributes from an input prim to the output prim, except for any specified to be removed.
static bool compute(OgnRemoveAttrDatabase& db)
{
auto& inputBundle = db.inputs.data();
auto& outputBundle = db.outputs.data();
outputBundle = inputBundle;
// Use pattern matching to find the attribute names.
std::vector<NameToken> attributes(outputBundle.attributeCount());
outputBundle.abi_bundleInterface()->getAttributeNames(attributes.data(), attributes.size());
std::vector<NameToken> remove;
remove.reserve(outputBundle.attributeCount());
std::string const& attrNamesToRemove = intToToken(db.inputs.attrNamesToRemove()).GetString();
PatternMatcher attrNameMatcher{ attrNamesToRemove };
// allow removing primitive internal attributes
if (!db.inputs.allowRemovePrimInternal())
attrNameMatcher.addExcludeTokens(getPrimAdditionalAttrs().names);
for (auto attribute : attributes)
{
if (attrNameMatcher && attrNameMatcher.matches(attribute))
{
remove.push_back(attribute);
}
}
if (!remove.empty())
{
outputBundle.removeAttributes(remove.size(), remove.data());
}
return true;
}
};
REGISTER_OGN_NODE()
} // nodes
} // graph
} // omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGpuInteropCudaEntry.cpp | // Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include "OgnGpuInteropCudaEntryDatabase.h"
#include <omni/graph/core/NodeTypeRegistrar.h>
#include <omni/graph/core/GpuInteropEntryUserData.h>
#include <omni/graph/core/iComputeGraph.h>
namespace omni
{
namespace graph
{
namespace core
{
// Replaces depreciated RenderPostprocessEntry
// Downstream nodes of OgnGpuInteropCudaEntry can write Cuda code directly and they will be scheduled on the
// Gpu Foundations Rendergraph for Device 0. GpuInteropCudaEntry passes the cuda buffer pointer and
// associated metadata for a specific named resource outputted by the Rtx Renderer (such as LdrColor for
// final color). This buffer is a read/write buffer, and changes will be passed to consumer of the renderer's
// output
class OgnGpuInteropCudaEntry
{
public:
static bool compute(OgnGpuInteropCudaEntryDatabase& db)
{
GpuInteropCudaEntryUserData* userData = static_cast<GpuInteropCudaEntryUserData*>(db.abi_node().iNode->getUserData(db.abi_node()));
if (!userData)
return false;
GpuInteropCudaResourceMap& cudaRsrcMap = userData->cudaRsrcMap;
std::string sourceName = db.inputs.sourceName();
auto it = cudaRsrcMap.find(sourceName);
if (it == cudaRsrcMap.end())
{
return false;
}
GpuInteropCudaResourceData& renderVarData = it->second;
db.outputs.cudaMipmappedArray() = (uint64_t)renderVarData.cudaResource;
db.outputs.width() = renderVarData.width;
db.outputs.height() = renderVarData.height;
db.outputs.isBuffer() = renderVarData.isBuffer;
db.outputs.bufferSize() = renderVarData.depthOrArraySize;
db.outputs.mipCount() = (uint32_t)renderVarData.mipCount;
db.outputs.format() = (uint64_t)renderVarData.format;
db.outputs.stream() = (uint64_t)userData->cudaStream;
db.outputs.simTime() = userData->simTime;
db.outputs.hydraTime() = userData->hydraTime;
db.outputs.externalTimeOfSimFrame() = userData->externalTimeOfSimFrame;
db.outputs.frameId() = userData->frameId;
return true;
}
static void initializeType(const NodeTypeObj& nodeTypeObj)
{
OgnGpuInteropCudaEntryDatabase::initializeType(nodeTypeObj);
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnAttrType.ogn | {
"AttributeType": {
"version": 1,
"description": ["Queries information about the type of a specified attribute in an input bundle"],
"metadata": {
"uiName": "Extract Attribute Type Information"
},
"categories": ["bundle"],
"scheduling": ["threadsafe"],
"inputs": {
"attrName": {
"type": "token",
"description": "The name of the attribute to be queried",
"default": "input",
"metadata": {
"uiName": "Attribute To Query"
}
},
"data": {
"type": "bundle",
"description": "Bundle of attributes to examine",
"metadata": {
"uiName": "Bundle To Examine"
}
}
},
"outputs": {
"baseType": {
"type": "int",
"description": ["An integer representing the type of the individual components.",
"Set to -1 if the named attribute was not in the bundle."],
"metadata": {
"uiName": "Attribute Base Type"
}
},
"componentCount": {
"type": "int",
"description": ["Number of components in each tuple, e.g. one for float, three for point3f, 16 for",
"matrix4d. Set to -1 if the named attribute was not in the bundle."],
"metadata": {
"uiName": "Attribute Component Count"
}
},
"arrayDepth": {
"type": "int",
"minimum": 0,
"maximum": 2,
"description": ["Zero for a single value, one for an array, two for an array of arrays.",
"Set to -1 if the named attribute was not in the bundle."],
"metadata": {
"uiName": "Attribute Array Depth"
}
},
"role": {
"type": "int",
"description": ["An integer representing semantic meaning of the type, e.g. point3f vs. normal3f vs. vector3f vs. float3.",
"Set to -1 if the named attribute was not in the bundle."],
"metadata": {
"uiName": "Attribute Role"
}
},
"fullType": {
"type": "int",
"description": ["A single int representing the full type information.",
"Set to -1 if the named attribute was not in the bundle."],
"metadata": {
"uiName": "Full Attribute Type"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnNoOp.ogn | {
"Noop": {
"description": "Empty node used only as a placeholder",
"version": 1,
"uiName": "No-Op",
"categories": ["debug"],
"scheduling": ["threadsafe"]
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnWritePrimMaterial.ogn | {
"WritePrimMaterial": {
"version": 1,
"description": [
"Given a path to a prim and a path to a material on the current USD stage,",
" assigns the material to the prim. Gives an error if the given prim or material",
" can not be found."
],
"uiName": "Write Prim Material",
"categories": [ "sceneGraph" ],
"scheduling": [ "usd-write" ],
"exclude": [ "tests" ],
"inputs": {
"primPath": {
"type": "path",
"description": "Path of the prim to be assigned a material.",
"deprecated": "Use prim input instead",
"uiName": "Prim Path"
},
"prim": {
"type": "target",
"description": "Prim to be assigned a material."
},
"materialPath": {
"type": "path",
"description": "The path of the material to be assigned to the prim",
"deprecated": "Use material input instead",
"uiName": "Material Path"
},
"material": {
"type": "target",
"description": "The material to be assigned to the prim"
},
"execIn": {
"type": "execution",
"description": "Input execution"
}
},
"outputs": {
"execOut": {
"type": "execution",
"description": "Output execution"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnWriteSetting.ogn | {
"WriteSetting": {
"version": 1,
"description": ["Node that writes a value to a kit application setting. Issues an error if input::value type",
" does not match setting type."
],
"uiName": "Write Setting",
"categories": ["sceneGraph"],
"scheduling": ["usd-write"],
"inputs": {
"settingPath": {
"type": "string",
"description": "The path of the setting to be modified"
},
"execIn": {
"type": "execution",
"description": "Input execution state"
},
"value": {
"type": ["arrays", "array_elements", "bool", "bool[]"],
"description": "The new value to be written"
}
},
"outputs": {
"execOut": {
"type": "execution",
"description": "Output execution"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnWritePrimAttribute.ogn | {
"WritePrimAttribute": {
"version": 2,
"description": ["Given a path to a prim on the current USD stage and the name of an attribute on",
" that prim, sets the value of that attribute. Does nothing if the given Prim or attribute",
"can not be found. If the attribute is found but it is not a compatible type,",
"an error will be issued."
],
"uiName": "Write Prim Attribute",
"categories": ["sceneGraph"],
"scheduling": ["usd-write", "threadsafe"],
"inputs": {
"primPath": {
"type": "token",
"description": "The path of the prim to be modified when 'usePath' is true",
"deprecated": "Use prim input with a GetPrimsAtPath node instead"
},
"usePath": {
"type": "bool",
"default": false,
"description": "When true, the 'primPath' attribute is used as the path to the prim being read, otherwise it will read the connection at the 'prim' attribute",
"deprecated": "Use prim input with a GetPrimsAtPath node instead"
},
"prim": {
"type": "target",
"description": "The prim to be modified when 'usePath' is false",
"optional": true
},
"name": {
"uiName": "Attribute Name",
"type": "token",
"description": "The name of the attribute to set on the specified prim"
},
"execIn": {
"type": "execution",
"description": "Input execution state"
},
"value": {
"type": "any",
"description": "The new value to be written"
},
"usdWriteBack": {
"uiName": "Persist To USD",
"type": "bool",
"default" : true,
"description": "Whether or not the value should be written back to USD, or kept a Fabric only value"
}
},
"outputs": {
"execOut": {
"type": "execution",
"description": "Output execution"
}
},
"state": {
"correctlySetup": {
"type": "bool",
"description": "Wheter or not the instance is properly setup",
"default": false
},
"destPath": {
"type": "uint64",
"description": "A PathC to the destination prim"
},
"destAttrib": {
"type": "uint64",
"description": "A TokenC to the destination attrib"
},
"destPathToken": {
"type": "uint64",
"description": "The TokenC version of destPath'"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnExtractAttr.ogn | {
"ExtractAttribute": {
"version": 1,
"description": ["Copies a single attribute from an input bundle to an output attribute directly on the node",
"if it exists in the input bundle and matches the type of the output attribute"],
"metadata": {
"uiName": "Extract Attribute"
},
"categories": ["bundle"],
"scheduling": ["threadsafe"],
"inputs": {
"attrName": {
"type": "token",
"description": "Name of the attribute to look for in the bundle",
"default": "points",
"metadata": {
"uiName": "Attribute To Extract"
}
},
"data": {
"type": "bundle",
"description": "Collection of attributes from which the named attribute is to be extracted",
"metadata": {
"uiName": "Bundle For Extraction"
}
}
},
"outputs": {
"output": {
"type": "any",
"description": "The single attribute extracted from the input bundle",
"metadata": {
"uiName": "Extracted Attribute"
},
"unvalidated": true
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnEventUpdateTick.cpp | // Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include "OgnEventUpdateTickDatabase.h"
namespace omni
{
namespace graph
{
namespace core
{
class OgnEventUpdateTick
{
public:
static bool compute(OgnEventUpdateTickDatabase& db)
{
// FIXME: temporary incomplete implementation. Always output event id of 0 for now.
// This is not useful of course, but does allow the event connenction to trigger.
// In time this should become a bundle, to incorporate information about the event
// received.
db.outputs.event() = 0;
return true;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGatherByPath.ogn | {
"GatherByPath": {
"description": [
"Node to vectorize data by paths passed in via input.",
"PROTOTYPE DO NOT USE. Requires GatherPrototype"
],
"version": 1,
"uiName": "Gather By Path (Prototype)",
"categories": ["internal"],
"inputs": {
"primPaths": {
"type": "token[]",
"description": "A list of Prim paths whose data should be vectorized"
},
"allAttributes": {
"type": "bool",
"description": "When true, all USD attributes will be gathered. Otherwise those specified by 'attributes' will be gathered.",
"default": true
},
"attributes": {
"type": "string",
"description": "A space-separated list of attribute names to be gathered when allAttributes is false"
},
"hydraFastPath" : {
"type": "token",
"description": [
"When not 'Disabled', will extract USD Geometry transforms into Hydra fast-path attributes.",
"'World' will add _worldPosition, _worldOrientation. 'Local' will add _localMatrix."
],
"metadata": {
"allowedTokens": ["Disabled", "World", "Local"]
},
"default": "Disabled"
},
"shouldWriteBack": {
"type": "bool",
"uiName": "Should Write Back To USD",
"description": "Write the data back into USD if true.",
"default": false
},
"forceExportToHistory": {
"type": "bool",
"description": "When true, all USD gathered paths will be tagged for being exported to the history.",
"default": false
},
"checkResyncAttributes": {
"type": "bool",
"description": "When true, the data vectorization will be updated when new attributes to the Prims are added.",
"default": false
}
},
"outputs": {
"gatherId": {
"description": "The GatherId corresponding to this Gather, kInvalidGatherId if the Gather failed",
"type": "uint64"
},
"gatheredPaths": {
"type": "token[]",
"description": "The list of gathered prim paths in gathered-order"
}
},
"tests": [
{
"setup": {
"create_nodes": [
["TestNode", "omni.graph.nodes.GatherByPath"]
],
"create_prims": [
["Empty", {}],
["Xform1", {"_translate": ["pointd[3]", [1, 2, 3]]}],
["Xform2", {"_translate": ["pointd[3]", [4, 5, 6]]}],
["XformTagged1", {"foo": ["token", ""], "_translate": ["pointd[3]", [1, 2, 3]]}],
["Tagged1", {"foo": ["token", ""]}]
]
},
"inputs": {
"primPaths": ["/Xform1", "/Xform2"],
"attributes": "_translate",
"allAttributes": false
},
"outputs": {
"gatheredPaths": ["/Xform1", "/Xform2"],
"gatherId": 1
}
},
{
"setup": {},
"inputs": {
"primPaths": ["/XformTagged1", "/Xform2", "/Xform1"],
"attributes": "_translate",
"allAttributes": false
},
"outputs": {
"gatheredPaths": ["/XformTagged1", "/Xform1", "/Xform2"]
}
}
]
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadSetting.ogn | {
"ReadSetting": {
"version": 1,
"description": ["Node that reads a value from a kit application setting"],
"uiName": "Read Setting",
"categories": ["sceneGraph"],
"scheduling": ["threadsafe"],
"inputs": {
"settingPath": {
"type": "string",
"description": "The path of the setting"
}
},
"outputs": {
"value": {
"type": ["arrays", "array_elements", "bool", "bool[]"],
"description": "The value of the setting that is returned"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGraphTarget.cpp | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include <OgnGraphTargetDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnGraphTarget
{
public:
static size_t computeVectorized(OgnGraphTargetDatabase& db, size_t count)
{
auto targets = db.getGraphTargets(count);
auto paths = db.outputs.primPath.vectorized(count);
memcpy(paths.data(), targets.data(), count * sizeof(NameToken));
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnHasAttr.ogn | {
"HasAttribute": {
"version": 1,
"description": ["Inspect an input bundle for a named attribute, setting output to true if it exists"],
"metadata": {
"uiName": "Has Attribute"
},
"categories": ["bundle"],
"scheduling": ["threadsafe"],
"inputs": {
"attrName": {
"type": "token",
"description": "Name of the attribute to look for in the bundle",
"default": "points",
"metadata": {
"uiName": "Attribute To Find"
}
},
"data": {
"type": "bundle",
"description": "Collection of attributes that may contain the named attribute",
"metadata": {
"uiName": "Bundle To Check"
}
}
},
"outputs": {
"output": {
"type": "bool",
"description": "True if the named attribute was found in the bundle",
"metadata": {
"uiName": "Is Attribute In Bundle"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnWritePrimMaterial.cpp | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include <omni/fabric/FabricUSD.h>
#include "OgnWritePrimMaterialDatabase.h"
using namespace omni::fabric;
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnWritePrimMaterial
{
public:
static bool compute(OgnWritePrimMaterialDatabase& db)
{
// Find our stage
const GraphContextObj& context = db.abi_context();
long stageId = context.iContext->getStageId(context);
PXR_NS::UsdStagePtr stage = pxr::UsdUtilsStageCache::Get().Find(pxr::UsdStageCache::Id::FromLongInt(stageId));
if (!stage)
{
db.logError("Could not find USD stage %ld", stageId);
return false;
}
PXR_NS::SdfPath sdfPath;
if(db.inputs.prim().size() == 0)
{
const auto& primPath = db.inputs.primPath();
if (!PXR_NS::SdfPath::IsValidPathString(primPath)) {
db.logError("Invalid prim path");
return false;
}
sdfPath = PXR_NS::SdfPath(primPath);
}
else
{
if(db.inputs.prim().size() > 1)
db.logWarning("Only one prim target is supported, the rest will be ignored");
sdfPath = omni::fabric::toSdfPath(db.inputs.prim()[0]);
}
PXR_NS::UsdPrim prim = stage->GetPrimAtPath(sdfPath);
if (!prim) {
db.logError("Could not find USD prim");
return false;
}
PXR_NS::SdfPath materialSdfPath;
if(db.inputs.material().size() == 0)
{
const auto& materialPath = db.inputs.materialPath();
if (!PXR_NS::SdfPath::IsValidPathString(materialPath)) {
db.logError("Invalid material path");
return false;
}
materialSdfPath = PXR_NS::SdfPath(materialPath);
}
else
{
if(db.inputs.material().size() > 1)
db.logWarning("Only one material target is supported, the rest will be ignored");
materialSdfPath = omni::fabric::toSdfPath(db.inputs.material()[0]);
}
PXR_NS::UsdPrim materialPrim = stage->GetPrimAtPath(materialSdfPath);
if (!materialPrim) {
db.logError("Could not find USD material");
return false;
}
PXR_NS::UsdShadeMaterialBindingAPI materialBinding(prim);
PXR_NS::UsdShadeMaterial material(materialPrim);
if (!materialBinding.Bind(material)) {
db.logError("Could not bind USD material to USD prim");
return false;
}
db.outputs.execOut() = kExecutionAttributeStateEnabled;
return true;
}
};
REGISTER_OGN_NODE()
} // namespace nodes
} // namespace graph
} // namespace omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadPrimMaterial.cpp | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include "OgnReadPrimMaterialDatabase.h"
#include <omni/fabric/FabricUSD.h>
using namespace omni::fabric;
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnReadPrimMaterial
{
public:
static bool compute(OgnReadPrimMaterialDatabase& db)
{
// Fetch from the target input by default, if it's not set,
// use the prim path
PXR_NS::SdfPath sdfPath;
if (db.inputs.prim.size() == 0)
{
const auto& primPath = db.inputs.primPath();
if (!PXR_NS::SdfPath::IsValidPathString(primPath))
{
db.logError("Invalid prim path");
return false;
}
sdfPath = PXR_NS::SdfPath(primPath);
}
else
{
sdfPath = omni::fabric::toSdfPath(db.inputs.prim()[0]);
}
// Find our stage
const GraphContextObj& context = db.abi_context();
long stageId = context.iContext->getStageId(context);
PXR_NS::UsdStagePtr stage = PXR_NS::UsdUtilsStageCache::Get().Find(pxr::UsdStageCache::Id::FromLongInt(stageId));
if (!stage)
{
db.logError("Could not find USD stage %ld", stageId);
return false;
}
PXR_NS::UsdPrim prim = stage->GetPrimAtPath(sdfPath);
if (!prim) {
db.logError("Could not find USD prim at %s", sdfPath.GetText());
return false;
}
PXR_NS::UsdShadeMaterialBindingAPI materialBinding(prim);
PXR_NS::UsdShadeMaterial boundMat = materialBinding.ComputeBoundMaterial();
if (!boundMat) {
db.outputs.material() = "";
db.outputs.materialPrim().resize(0);
return true;
}
db.outputs.material() = boundMat.GetPath().GetString().c_str();
db.outputs.materialPrim().resize(1);
db.outputs.materialPrim()[0] = omni::fabric::asInt(boundMat.GetPath());
return true;
}
};
REGISTER_OGN_NODE()
} // namespace nodes
} // namespace graph
} // namespace omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnWritePrimAttribute.cpp | // Copyright (c) 2021-2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include <memory>
#include "PrimCommon.h"
#include <omni/fabric/FabricUSD.h>
#include <omni/usd/UsdContext.h>
#include <OgnWritePrimAttributeDatabase.h>
using namespace omni::fabric;
namespace omni
{
namespace graph
{
namespace nodes
{
// WARNING!
// The following code uses low-level ABI functionality and should not be copied for other purposes when such
// low level access is not required. Please use the OGN-generated API whenever possible.
static const pxr::TfType s_tokenTfType = pxr::SdfValueTypeNames->Token.GetType();
static const TypeC s_tokenType = TypeC(Type(BaseDataType::eToken));
static thread_local bool recursiveSetupGuard = false;
class OgnWritePrimAttribute
{
static void setup(NodeObj const& nodeObj, GraphObj const& graphObj, OgnWritePrimAttributeDatabase& db, size_t offset)
{
// Check for re-entering setup and avoid. EG When input is being resolved we may get onConnectionTypeResolve()
if (recursiveSetupGuard)
return;
CARB_PROFILE_ZONE(1, "setup");
recursiveSetupGuard = true;
std::shared_ptr<nullptr_t> atScopeExit(nullptr, [](auto) { recursiveSetupGuard = false; });
InstanceIndex instanceIndex = db.getInstanceIndex() + offset;
db.state.correctlySetup(offset) = false;
GraphContextObj context{ graphObj.iGraph->getDefaultGraphContext(graphObj) };
if (context.contextHandle == kInvalidGraphContextHandle)
return;
auto typeInterface{ carb::getCachedInterface<omni::graph::core::IAttributeType>() };
pxr::UsdAttribute attrib;
try
{
attrib = omni::graph::nodes::findSelectedAttribute(context, nodeObj, instanceIndex);
}
catch (std::runtime_error const&)
{
// Ignore errors in this callback - error will be reported at the next compute
return;
}
if (!attrib)
{
// Couldn't get the indicated attribute for some expected reason
return;
}
// Since we are a sink of data, we can assume that if our inputs:value is connected, it will be resolved by
// propagation from upstream. We do not want to resolve/unresolve our inputs:value if we are connected because
// this could create a type conflict with the upstream network. So instead we will only resolve/unresolve
// when we are disconnected, and otherwise error out if we see a conflict.
auto typeName{ attrib ? attrib.GetTypeName().GetAsToken() : pxr::TfToken() };
Type usdAttribType{ typeInterface->typeFromSdfTypeName(typeName.GetText()) };
if (!tryResolveInputAttribute(nodeObj, inputs::value.m_token, usdAttribType))
return;
AttributeObj srcData = nodeObj.iNode->getAttributeByToken(nodeObj, inputs::value.m_token);
Type srcDataType = srcData.iAttribute->getResolvedType(srcData);
TypeC srcDataTypeC(srcDataType);
// no need to continue if we are not resolved yet
if (srcDataType == Type(BaseDataType::eUnknown))
return;
IFabricUsd* iFabricUsd = carb::getCachedInterface<IFabricUsd>();
// Find our stage
pxr::UsdStageRefPtr stage;
omni::fabric::FabricId fabricId;
std::tie(fabricId, stage) = getFabricForNode(context, nodeObj);
if (fabricId == omni::fabric::kInvalidFabricId)
return;
pxr::UsdPrim destPrim{ attrib.GetPrim() };
NameToken destAttribName = asInt(attrib.GetName());
// Add the destination Prim to FC
BucketId destPrimBucketId = omni::graph::nodes::addAttribToCache(
destPrim, destPrim.GetPath(), destAttribName, iFabricUsd, fabricId, UsdTimeCode::Default());
if (destPrimBucketId == kInvalidBucketId)
{
OgnWritePrimAttributeDatabase::logError(nodeObj, "Unable to add prim %s to fabric", destPrim.GetPrimPath().GetText());
return;
}
PathC destPath = asInt(destPrim.GetPrimPath());
// Read the type info of the destination attribute
auto iStageReaderWriter = carb::getCachedInterface<omni::fabric::IStageReaderWriter>();
auto stageReaderWriterId = iStageReaderWriter->createOrGetFromFabricId(fabricId);
if (iStageReaderWriter->attributeExists(stageReaderWriterId,destPath, destAttribName) == 0)
{
// Failed to add the attribute - it might not be authored
// --------------------------------------------------------------------------------------
// Get PrimVar into fabric by creating it on the prim
if (pxr::UsdGeomPrimvar::IsPrimvar(attrib))
{
// Primvars have to go through prim var api. Note that we don't set the value here. That is because we
// will be subsequently writing into the attribute through Fabric.
if (auto primVarAPI = pxr::UsdGeomPrimvarsAPI(destPrim))
{
if (pxr::UsdGeomPrimvar primVar = primVarAPI.FindPrimvarWithInheritance(attrib.GetName()))
{
primVarAPI.CreatePrimvar(attrib.GetName(), primVar.GetTypeName());
}
}
}
else
{
// --------------------------------------------------------------------------------------
// Get non-primvar into fabric by authoring the attribute with the composed value
pxr::VtValue val;
if (!attrib.Get(&val))
{
OgnWritePrimAttributeDatabase::logError(
nodeObj, "Unable to read %s of type %s", attrib.GetPath().GetText(), val.GetTypeName().c_str());
return;
}
if (!attrib.Set(val))
{
OgnWritePrimAttributeDatabase::logError(nodeObj, "Unable to author %s with value of type %s",
attrib.GetPath().GetText(),
val.GetTypeName().c_str());
return;
}
}
if (omni::graph::nodes::addAttribToCache(destPrim, destPrim.GetPath(), destAttribName, iFabricUsd,
fabricId, UsdTimeCode::Default()) == kInvalidBucketId)
{
OgnWritePrimAttributeDatabase::logError(
nodeObj, "Unable to add prim %s to fabric", destPrim.GetPrimPath().GetText());
return;
}
}
TypeC destDataTypeC = TypeC(iStageReaderWriter->getType(stageReaderWriterId,destPath, destAttribName));
if (destDataTypeC == kUnknownType)
{
OgnWritePrimAttributeDatabase::logError(
nodeObj, "Unable to add prim %s to fabric", destPrim.GetPrimPath().GetText());
return;
}
Type destDataType(destDataTypeC);
if (!ogn::areTypesCompatible(srcDataType, destDataType))
{
OgnWritePrimAttributeDatabase::logError(
nodeObj, "Attribute %s.%s is not compatible with type '%s', please disconnect to change target attribute",
destPrim.GetPrimPath().GetText(), toTfToken(destAttribName).GetText(), srcDataType.getTypeName().c_str());
return;
}
db.state.destPath(offset) = destPath.path;
db.state.destPathToken(offset) = asInt(destPrim.GetPrimPath().GetToken()).token;
db.state.destAttrib(offset) = destAttribName.token;
db.state.correctlySetup(offset) = true;
}
public:
// ----------------------------------------------------------------------------
// Called by OG when our prim attrib changes. We want to catch the case of changing the prim attribute interactively
static void onValueChanged(AttributeObj const& attrObj, void const* userData)
{
// FIXME: Be pedantic about validity checks - this can be run directly by the TfNotice so who knows
// when or where this is happening
NodeObj nodeObj{ attrObj.iAttribute->getNode(attrObj) };
if (nodeObj.nodeHandle == kInvalidNodeHandle)
return;
GraphObj graphObj{ nodeObj.iNode->getGraph(nodeObj) };
if (graphObj.graphHandle == kInvalidGraphHandle)
return;
GraphContextObj contextObj = graphObj.iGraph->getDefaultGraphContext(graphObj);
OgnWritePrimAttributeDatabase db(contextObj, nodeObj);
setup(nodeObj, graphObj, db, 0);
}
// ----------------------------------------------------------------------------
static void initialize(GraphContextObj const& context, NodeObj const& nodeObj)
{
// We need to check resolution if any of our relevant inputs change
static std::array<NameToken, 5> const attribNames{ inputs::name.m_token, inputs::usePath.m_token, inputs::primPath.m_token,
inputs::prim.m_token , inputs::value.m_token };
for (auto const& attribName : attribNames)
{
AttributeObj attribObj = nodeObj.iNode->getAttributeByToken(nodeObj, attribName);
attribObj.iAttribute->registerValueChangedCallback(attribObj, onValueChanged, true);
}
}
// ----------------------------------------------------------------------------
static void onConnectionTypeResolve(const NodeObj& nodeObj)
{
GraphObj graphObj{ nodeObj.iNode->getGraph(nodeObj) };
if (graphObj.graphHandle == kInvalidGraphHandle)
return;
GraphContextObj contextObj = graphObj.iGraph->getDefaultGraphContext(graphObj);
OgnWritePrimAttributeDatabase db(contextObj, nodeObj);
setup(nodeObj, graphObj, db, 0);
}
// ----------------------------------------------------------------------------
static bool computeVectorized(OgnWritePrimAttributeDatabase& db, size_t count)
{
if (!db.inputs.value().resolved())
return true;
NodeObj nodeObj = db.abi_node();
GraphContextObj context = db.abi_context();
GraphObj graphObj = nodeObj.iNode->getGraph(nodeObj);
Type type = db.inputs.value().type();
bool gpuValid = context.iAttributeData->gpuValid(db.inputs.value().abi_handle(), context);
// for array or GPU attributes, go through the data model to properly handle the copy
const bool useDataModel = type.arrayDepth || gpuValid || !db.inputs.value.canVectorize();
auto usePath = db.inputs.usePath.vectorized(count);
auto primPath = db.inputs.primPath.vectorized(count);
auto name = db.inputs.name.vectorized(count);
auto execOut = db.outputs.execOut.vectorized(count);
auto usdWriteBack = db.inputs.usdWriteBack.vectorized(count);
auto correctlySetup = db.state.correctlySetup.vectorized(count);
auto destPathToken = db.state.destPathToken.vectorized(count);
auto destAttrib = db.state.destAttrib.vectorized(count);
auto destPath = db.state.destPath.vectorized(count);
for (size_t idx = 0; idx < count; ++idx)
{
if (!correctlySetup[idx])
{
setup(nodeObj, graphObj, db, idx);
}
else
{
auto path = usePath[idx] ? primPath[idx].token : db.pathToToken(db.inputs.prim.firstOrDefault(idx));
if (path != destPathToken[idx] || name[idx] != destAttrib[idx])
setup(nodeObj, graphObj, db, idx);
}
}
if (useDataModel)
{
for (size_t idx = 0; idx < count; ++idx)
{
if (correctlySetup[idx])
{
copyAttributeData(context, destPath[idx], destAttrib[idx], nodeObj,
db.inputs.value(idx).abi_handle(), usdWriteBack[idx]);
execOut[idx] = kExecutionAttributeStateEnabled;
}
}
}
else
{
// gather src base pointer
uint8_t const* srcData = nullptr;
size_t stride = 0;
db.inputs.value().rawData(srcData, stride);
// retrieve dst pointers
std::vector<AttributeDataHandle> dstHandles;
dstHandles.reserve(count);
for (size_t idx = 0; idx < count; ++idx)
{
if (correctlySetup[idx])
dstHandles.emplace_back(AttrKey{ destPath[idx], destAttrib[idx] });
else
dstHandles.push_back(AttributeDataHandle::invalidHandle());
}
std::vector<void*> dstData;
dstData.resize(count);
{
CARB_PROFILE_ZONE(1, "Retrieve Pointers");
context.iAttributeData->getDataW(dstData.data(), context, dstHandles.data(), count);
}
size_t writeBackCount = 0;
for (size_t idx = 0; idx < count; ++idx)
{
if (correctlySetup[idx])
{
void const* const src = srcData + idx * stride;
if(dstData[idx])
{
memcpy(dstData[idx], src, stride);
if (usdWriteBack[idx])
{
if (idx != writeBackCount)
dstHandles[writeBackCount] = dstHandles[idx];
++writeBackCount;
}
execOut[idx] = kExecutionAttributeStateEnabled;
}
else
{
db.logError("Target attribute not available");
}
}
}
if (writeBackCount)
{
CARB_PROFILE_ZONE(1, "RegisterWriteBack");
context.iContext->registerForUSDWriteBacks(context, dstHandles.data(), writeBackCount);
}
}
return true;
}
};
REGISTER_OGN_NODE()
} // namespace nodes
} // namespace graph
} // namespace omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGetGraphTargetId.cpp | // Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnGetGraphTargetIdDatabase.h>
namespace omni::graph::nodes
{
class OgnGetGraphTargetId
{
public:
static size_t computeVectorized(OgnGetGraphTargetIdDatabase& db, size_t count)
{
auto targets = db.getGraphTargets(count);
auto targetId = db.outputs.targetId.vectorized(count);
std::transform(targets.begin(), targets.end(), targetId.begin(), [](auto const& t) {
return omni::fabric::hash(t);
});
return count;
}
};
REGISTER_OGN_NODE()
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnGatherByPath.cpp | // Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
//
#include <OgnGatherByPathDatabase.h>
#include <omni/graph/core/IGatherPrototype.h>
#include <carb/flatcache/IPath.h>
#include <algorithm>
#include <vector>
using namespace carb::flatcache;
namespace omni
{
namespace graph
{
namespace core
{
class OgnGatherByPath
{
// The arguments from the last compute call - we want to skip our compute if these haven't changed, and we
// haven't heard that our Gather has changed.
struct LastComputeState
{
// copies of input values
std::vector<NameToken> primPathTokens; // Used in compute to compare to input tokens
bool allAttributes{ false };
std::string attributes;
NameToken hydraFastPath{ 0 };
bool shouldWriteBack;
bool forceExportToHistory{ false };
// data use by path-changed callback
std::vector<PathC> primPaths; // Used in OG callback to compare with given paths
PathChangedCallback callback{ nullptr, nullptr };
bool checkResyncAttributes{ false }; // Set to true to be notified for resync children
bool gatherDirty{ false }; // Set to true by OG callback
const carb::flatcache::IPath * iPath = nullptr;
};
public:
LastComputeState m_state;
// Called by OG when anything changes - which indicates buckets may have been modified
static void onPathChanged(const carb::flatcache::PathC* paths, const size_t numPaths, void* userData)
{
NodeHandle nodeHandle = reinterpret_cast<NodeHandle>(userData);
auto& state =
OgnGatherByPathDatabase::sm_stateManagerOgnGatherByPath.getState<OgnGatherByPath>(nodeHandle).m_state;
// set the dirty flag if we recognize one of the changed prim paths - which will indicate a 'resync' notice
// we don't care about attribute values changing
const auto& gatheredPaths = state.primPaths;
auto iter = std::find_first_of(gatheredPaths.begin(), gatheredPaths.end(), paths, paths + numPaths);
state.gatherDirty = (iter != gatheredPaths.end());
if (!state.gatherDirty && state.checkResyncAttributes && state.iPath)
{
auto& iPath = state.iPath;
auto iter = std::find_first_of(gatheredPaths.begin(), gatheredPaths.end(), paths, paths + numPaths,
[iPath](const PathC a, const PathC b) { return a == iPath->getParent(b); });
state.gatherDirty = (iter != gatheredPaths.end());
}
}
// ----------------------------------------------------------------------------
static void initialize(const GraphContextObj& context, const NodeObj& nodeObj)
{
auto& cppObj = OgnGatherByPathDatabase::sInternalState<OgnGatherByPath>(nodeObj);
cppObj.m_state.callback = { &onPathChanged, reinterpret_cast<void*>(nodeObj.nodeHandle) };
nodeObj.iNode->registerPathChangedCallback(nodeObj, cppObj.m_state.callback);
}
// ----------------------------------------------------------------------------
static void release(const NodeObj& nodeObj)
{
auto& cppObj = OgnGatherByPathDatabase::sInternalState<OgnGatherByPath>(nodeObj);
nodeObj.iNode->deregisterPathChangedCallback(nodeObj, cppObj.m_state.callback);
}
// ----------------------------------------------------------------------------
static bool compute(OgnGatherByPathDatabase& db)
{
const omni::graph::core::IGatherPrototype* iGatherPrototype =
carb::getCachedInterface<omni::graph::core::IGatherPrototype>();
const IGraphContext& iContext = *db.abi_context().iContext;
auto& cppObj = db.internalState<OgnGatherByPath>();
LastComputeState& state = cppObj.m_state;
const auto& primPathTokens = db.inputs.primPaths();
bool allAttributes = db.inputs.allAttributes();
const auto& attributes = db.inputs.attributes();
auto hydraFastPathToken = db.inputs.hydraFastPath();
const bool& shouldWriteBack = db.inputs.shouldWriteBack();
bool forceExportToHistory = db.inputs.forceExportToHistory();
if (primPathTokens.empty())
return true;
state.checkResyncAttributes = db.inputs.checkResyncAttributes();
state.iPath = db.abi_context().iPath;
// We can skip this compute if our state isn't dirty AND none of our inputs have changed
if (!state.gatherDirty
&& (allAttributes == state.allAttributes)
&& (attributes == state.attributes)
&& (hydraFastPathToken == state.hydraFastPath)
&& (primPathTokens.size() == state.primPathTokens.size())
&& (shouldWriteBack == state.shouldWriteBack)
&& (forceExportToHistory == state.forceExportToHistory)
&& std::equal(primPathTokens.begin(), primPathTokens.end(), state.primPathTokens.begin()))
{
return true;
}
// convert the given NameToken[] to PathC[]
std::vector<PathC> paths;
paths.resize(primPathTokens.size());
std::transform(primPathTokens.begin(), primPathTokens.end(), paths.begin(),
[&](const auto& p) { return db.abi_context().iPath->getHandle(db.tokenToString(p)); });
// Save the input args to our per-instance state
state.primPaths.resize(paths.size());
state.primPathTokens.resize(paths.size());
std::copy(paths.begin(), paths.end(), state.primPaths.begin());
std::copy(primPathTokens.begin(), primPathTokens.end(), state.primPathTokens.begin());
state.allAttributes = allAttributes;
state.attributes = attributes;
state.hydraFastPath = hydraFastPathToken;
state.shouldWriteBack = shouldWriteBack;
state.forceExportToHistory = forceExportToHistory;
// tokenize the given list of space-separated attribute names
std::vector<NameToken> gatherAttribs;
if (!attributes.empty())
{
if (allAttributes)
{
CARB_LOG_ERROR("'attributes' specified, but allAttributes is true");
return false;
}
std::istringstream iss(attributes);
std::string word;
while (std::getline(iss, word, ' '))
{
if (!word.empty())
gatherAttribs.push_back(db.stringToToken(word.c_str()));
}
}
GatherAddTransformsMode hydraTransformsMode = GatherAddTransformsMode::eNone;
if (hydraFastPathToken == db.tokens.Local)
hydraTransformsMode = GatherAddTransformsMode::eLocal;
else if (hydraFastPathToken == db.tokens.World)
hydraTransformsMode = GatherAddTransformsMode::eWorld;
// Make the Gather ABI call
GatherId gatherId = iGatherPrototype->gatherPaths(
db.abi_context(), paths.data(), paths.size(),
allAttributes, gatherAttribs.data(), gatherAttribs.size(), hydraTransformsMode, shouldWriteBack, forceExportToHistory);
db.outputs.gatherId() = gatherId;
// If the gather succeeded, copy the gathered paths into the output
if (gatherId != kInvalidGatherId)
{
size_t gatheredPathsSize{ 0 };
PathC const* gatheredPaths{ nullptr };
size_t repeatedPathsSize{ 0 };
PathBucketIndex const* repeatedPaths{ nullptr };
if (iGatherPrototype->getGatheredPaths(db.abi_context(), gatherId, gatheredPaths, gatheredPathsSize) &&
iGatherPrototype->getGatheredRepeatedPaths(db.abi_context(), gatherId, repeatedPaths, repeatedPathsSize))
{
db.outputs.gatheredPaths().resize(gatheredPathsSize + repeatedPathsSize);
std::transform(gatheredPaths, gatheredPaths + gatheredPathsSize, db.outputs.gatheredPaths().begin(),
[&db](PathC const& path) {
Path pathWrap(path);
return db.stringToToken(pathWrap.getText());
});
std::transform(repeatedPaths, repeatedPaths + repeatedPathsSize, db.outputs.gatheredPaths().begin() + gatheredPathsSize,
[&db](PathBucketIndex const& pathBucketIndex) {
Path pathWrap(std::get<0>(pathBucketIndex));
return db.stringToToken(pathWrap.getText());
});
// clear the state gather dirty flag
state.gatherDirty = false;
return true;
}
}
db.outputs.gatheredPaths().resize(0);
CARB_LOG_ERROR("Could not gather paths");
return false;
}
};
REGISTER_OGN_NODE()
} // namespace core
} // namespace graph
} // namespace omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadPrimRelationship.ogn | {
"ReadPrimRelationship": {
"version": 1,
"description": "Reads the target(s) of a relationship on a given prim",
"uiName": "Read Prim Relationship",
"categories": ["sceneGraph"],
"scheduling": ["usd-read", "threadsafe"],
"exclude": ["usd"],
"inputs": {
"prim": {
"type": "target",
"description": "The prim with the named relationship to read"
},
"name": {
"type": "token",
"uiName": "Relationship Name",
"description": "The name of the relationship to read"
}
},
"outputs": {
"value": {
"type": "target",
"description": "The relationship target(s)"
}
},
"state": {
"correctlySetup": {
"type": "bool",
"description": "Whether or not the instance is properly setup",
"default": false
},
"prim": {
"type": "target",
"description": "The currently prefetched prim"
},
"name": {
"type": "token",
"description": "The prefetched relationship name"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/core/OgnReadPrimRelationship.cpp | // Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
#include <OgnReadPrimRelationshipDatabase.h>
#include "PrimCommon.h"
namespace omni {
namespace graph {
namespace nodes {
class OgnReadPrimRelationship {
public:
// ----------------------------------------------------------------------------
// Prefetch prim to fabric
static void setup(NodeObj const& nodeObj, GraphObj const& graphObj, OgnReadPrimRelationshipDatabase& db, size_t offset)
{
db.state.correctlySetup(offset) = false;
TargetPath prim = db.inputs.prim.firstOrDefault(offset);
NameToken name = db.inputs.name(offset);
std::set<omni::fabric::TokenC> attributes = {name.token};
prefetchPrim(graphObj, nodeObj, prim, attributes);
db.state.correctlySetup(offset) = true;
db.state.prim(offset).resize(1);
db.state.prim(offset)[0] = prim;
db.state.name(offset) = name;
}
// ----------------------------------------------------------------------------
// Called by OG when attribute changes
static void onValueChanged(AttributeObj const& attrObj, void const* userData)
{
NodeObj nodeObj{ attrObj.iAttribute->getNode(attrObj) };
if (nodeObj.nodeHandle == kInvalidNodeHandle)
return;
GraphObj graphObj{ nodeObj.iNode->getGraph(nodeObj) };
if (graphObj.graphHandle == kInvalidGraphHandle)
return;
GraphContextObj contextObj = graphObj.iGraph->getDefaultGraphContext(graphObj);
OgnReadPrimRelationshipDatabase db(contextObj, nodeObj);
setup(nodeObj, graphObj, db, 0);
}
// ----------------------------------------------------------------------------
static void initialize(GraphContextObj const& context, NodeObj const& nodeObj)
{
std::array<NameToken, 2> attribNames{inputs::name.m_token, inputs::prim.m_token};
for (auto const& attribName : attribNames)
{
AttributeObj attribObj = nodeObj.iNode->getAttributeByToken(nodeObj, attribName);
attribObj.iAttribute->registerValueChangedCallback(attribObj, onValueChanged, true);
}
}
// ----------------------------------------------------------------------------
static size_t computeVectorized(OgnReadPrimRelationshipDatabase& db, size_t count)
{
NodeObj nodeObj = db.abi_node();
GraphContextObj context = db.abi_context();
GraphObj graphObj = nodeObj.iNode->getGraph(nodeObj);
auto name = db.inputs.name.vectorized(count);
auto correctlySetup = db.state.correctlySetup.vectorized(count);
auto nameState = db.state.name.vectorized(count);
for (size_t idx = 0; idx < count; ++idx)
{
TargetPath curPrim = db.inputs.prim.firstOrDefault(idx);
if(!correctlySetup[idx] ||
db.state.prim(idx).size() == 0 ||
db.state.prim(idx)[0] != curPrim ||
nameState[idx] != name[idx])
{
setup(nodeObj, graphObj, db, idx);
}
gsl::span<TargetPath> targets = getRelationshipTargets(context,
nodeObj,
curPrim,
name[idx]);
db.outputs.value(idx).resize(targets.size());
for(size_t i = 0; i < targets.size(); i++)
{
db.outputs.value(idx)[i] = targets[i];
}
}
return count;
}
};
REGISTER_OGN_NODE()
}// namespace nodes
}// namespace graph
}// namespace omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/usd/OgnIsPrimSelected.cpp | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include <omni/usd/Selection.h>
#include <omni/usd/UsdContext.h>
#include <OgnIsPrimSelectedDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnIsPrimSelected
{
public:
static bool compute(OgnIsPrimSelectedDatabase& db)
{
omni::usd::UsdContext* usdContext = omni::usd::UsdContext::getContext();
NameToken primPathToken = db.inputs.primPath();
bool isSelected {false};
if (primPathToken != carb::flatcache::kUninitializedToken)
{
char const* primPath = db.abi_context().iToken->getText(primPathToken);
if (primPath)
isSelected = usdContext->getSelection()->isPrimPathSelected(primPath);
}
db.outputs.isSelected() = isSelected;
return true;
}
};
REGISTER_OGN_NODE()
} // nodes
} // graph
} // omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/usd/OgnReadStageSelection.ogn | {
"ReadStageSelection": {
"version": 1,
"description": [
"Outputs the current stage selection as a list of paths"
],
"uiName": "Read Stage Selection",
"categories": ["sceneGraph"],
"scheduling": ["usd-read"],
"inputs": {
},
"outputs": {
"selectedPrims": {
"type": "token[]",
"description": "The currently selected path(s)"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/usd/OgnReadStageSelection.cpp | // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// clang-format off
#include "UsdPCH.h"
// clang-format on
#include <omni/usd/Selection.h>
#include <omni/usd/UsdContext.h>
#include <OgnReadStageSelectionDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnReadStageSelection
{
public:
static bool compute(OgnReadStageSelectionDatabase& db)
{
omni::usd::UsdContext* usdContext = omni::usd::UsdContext::getContext();
PXR_NS::SdfPathVector selectedPaths = usdContext->getSelection()->getSelectedPrimPathsV2();
ogn::array<NameToken>& selectedPrims = db.outputs.selectedPrims();
selectedPrims.resize(selectedPaths.size());
std::transform(selectedPaths.begin(), selectedPaths.end(), selectedPrims.begin(),
[&db](PXR_NS::SdfPath const& path)
{
std::string const& s = path.GetString();
auto tokenC = db.abi_context().iToken->getHandle(s.c_str());
return tokenC;
});
return true;
}
};
REGISTER_OGN_NODE()
} // nodes
} // graph
} // omni
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/usd/OgnIsPrimSelected.ogn | {
"IsPrimSelected": {
"version": 1,
"description": [
"Checks if the prim at the given path is currently selected"
],
"uiName": "Is Prim Selected",
"categories": ["sceneGraph"],
"scheduling": ["usd-read"],
"inputs": {
"primPath": {
"type": "token",
"description": "The prim path to check"
}
},
"outputs": {
"isSelected": {
"type": "bool",
"description": "True if the given path is in the current stage selection"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord2f.ogn | {
"ConstantTexCoord2f": {
"description": [
"Holds a 2D uv texture coordinate."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "texcoordf[2]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord3f.ogn | {
"ConstantTexCoord3f": {
"description": [
"Holds a 3D uvw texture coordinate."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "texcoordf[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord3h.ogn | {
"ConstantTexCoord3h": {
"description": [
"Holds a 3D uvw texture coordinate."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "texcoordh[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt64.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantInt64Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantInt64
{
public:
static size_t computeVectorized(OgnConstantInt64Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf4.ogn | {
"ConstantHalf4": {
"description": [
"Holds a 4-component half constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "half[4]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble3.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantDouble3Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantDouble3
{
public:
static size_t computeVectorized(OgnConstantDouble3Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord3f.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantTexCoord3fDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantTexCoord3f
{
public:
static size_t computeVectorized(OgnConstantTexCoord3fDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat.ogn | {
"ConstantFloat": {
"description": "Holds a 32 bit floating point value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "float",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantBool.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantBoolDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantBool
{
public:
static size_t computeVectorized(OgnConstantBoolDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt2.ogn | {
"ConstantInt2": {
"description": [
"Holds a 2-component int constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "int[2]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf3.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantHalf3Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantHalf3
{
public:
static size_t computeVectorized(OgnConstantHalf3Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantToken.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantTokenDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantToken
{
public:
static size_t computeVectorized(OgnConstantTokenDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantColor4f.ogn | {
"ConstantColor4f": {
"description": [
"Holds a 4-component color constant, which is energy-linear RGBA, not pre-alpha multiplied"
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "colorf[4]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPath.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantPathDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantPath
{
public:
static size_t computeVectorized(OgnConstantPathDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantDoubleDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantDouble
{
public:
static size_t computeVectorized(OgnConstantDoubleDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantHalfDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantHalf
{
public:
static size_t computeVectorized(OgnConstantHalfDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantUInt64.ogn | {
"ConstantUInt64": {
"description": "Holds a 64 bit signed integer value",
"version": 1,
"categories": ["constants"],
"uiName": "Constant UInt64",
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "uint64",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble4.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantDouble4Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantDouble4
{
public:
static size_t computeVectorized(OgnConstantDouble4Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantQuatf.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantQuatfDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantQuatf
{
public:
static size_t computeVectorized(OgnConstantQuatfDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantToken.ogn | {
"ConstantToken": {
"description": "Holds a token value, which is a 64-bit value representing an interned string",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "token",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPi.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantPiDatabase.h>
#include <omni/math/linalg/math.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantPi
{
public:
static size_t computeVectorized(OgnConstantPiDatabase& db, size_t count)
{
auto ptr = db.outputs.value.vectorized(count);
auto pFactor = db.inputs.factor.vectorized(count);
for (size_t i =0 ; i < count; ++i)
ptr[i] = pFactor[i] * M_PI;
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantBool.ogn | {
"ConstantBool": {
"description": "Holds a boolean value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "bool",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble2.ogn | {
"ConstantDouble2": {
"description": [
"Holds a 2-component double constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "double[2]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPoint3f.ogn | {
"ConstantPoint3f": {
"description": [
"Holds a 3-component float constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "pointf[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantUInt.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantUIntDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantUInt
{
public:
static size_t computeVectorized(OgnConstantUIntDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat2.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantFloat2Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantFloat2
{
public:
static size_t computeVectorized(OgnConstantFloat2Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPoint3d.ogn | {
"ConstantPoint3d": {
"description": [
"Holds a 3-component double constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "pointd[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble2.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantDouble2Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantDouble2
{
public:
static size_t computeVectorized(OgnConstantDouble2Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantColor3f.ogn | {
"ConstantColor3f": {
"description": [
"Holds a 3-component color constant, which is energy-linear RGB"
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "colorf[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt64.ogn | {
"ConstantInt64": {
"description": "Holds a 64 bit signed integer constant value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "int64",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantQuatd.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantQuatdDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantQuatd
{
public:
static size_t computeVectorized(OgnConstantQuatdDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantUInt.ogn | {
"ConstantUInt": {
"description": "Holds a 32 bit unsigned integer value",
"version": 1,
"categories": ["constants"],
"uiName": "Constant UInt",
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "uint",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf3.ogn | {
"ConstantHalf3": {
"description": [
"Holds a 3-component half-precision constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "half[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPi.ogn | {
"ConstantPi": {
"description": "Holds a 64-bit floating point constant value that is a multiple of Pi",
"version": 1,
"categories": ["constants"],
"scheduling": ["threadsafe"],
"inputs": {
"factor": {
"type": "double",
"description": "Multiply this by Pi to get the result",
"uiName": "Factor",
"default": 1
}
},
"outputs": {
"value": {
"type": "double",
"description": "Pi multiplied by the input factor",
"uiName": "Value"
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord2h.ogn | {
"ConstantTexCoord2h": {
"description": [
"Holds a 2D uv texture coordinate."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "texcoordh[2]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord3h.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantTexCoord3hDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantTexCoord3h
{
public:
static size_t computeVectorized(OgnConstantTexCoord3hDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantFloatDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantFloat
{
public:
static size_t computeVectorized(OgnConstantFloatDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt.ogn | {
"ConstantInt": {
"description": "Holds a 32 bit signed integer constant value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "int",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantQuatf.ogn | {
"ConstantQuatf": {
"description": [
"Holds a single-precision quaternion constant: A real coefficient and three imaginary coefficients."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "quatf[4]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt4.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantInt4Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantInt4
{
public:
static size_t computeVectorized(OgnConstantInt4Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat3.ogn | {
"ConstantFloat3": {
"description": [
"Holds a 3-component float constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "float[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantString.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantStringDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantString
{
public:
static size_t computeVectorized(OgnConstantStringDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat2.ogn | {
"ConstantFloat2": {
"description": [
"Holds a 2-component float constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "float[2]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble3.ogn | {
"ConstantDouble3": {
"description": [
"Holds a 3-component double constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "double[3]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord2h.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantTexCoord2hDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantTexCoord2h
{
public:
static size_t computeVectorized(OgnConstantTexCoord2hDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf2.ogn | {
"ConstantHalf2": {
"description": [
"Holds a 2-component half constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "half[2]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf4.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantHalf4Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantHalf4
{
public:
static size_t computeVectorized(OgnConstantHalf4Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantColor4f.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantColor4fDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantColor4f
{
public:
static size_t computeVectorized(OgnConstantColor4fDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantTexCoord2f.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantTexCoord2fDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantTexCoord2f
{
public:
static size_t computeVectorized(OgnConstantTexCoord2fDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf2.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantHalf2Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantHalf2
{
public:
static size_t computeVectorized(OgnConstantHalf2Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantUChar.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantUCharDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantUChar
{
public:
static size_t computeVectorized(OgnConstantUCharDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantUChar.ogn | {
"ConstantUChar": {
"description": "Holds an 8-bit unsigned character value",
"version": 1,
"categories": ["constants"],
"uiName": "Constant UChar",
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "uchar",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantHalf.ogn | {
"ConstantHalf": {
"description": "Holds a 16-bit floating point value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "half",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantUInt64.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantUInt64Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantUInt64
{
public:
static size_t computeVectorized(OgnConstantUInt64Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantQuatd.ogn | {
"ConstantQuatd": {
"description": [
"Holds a double-precision quaternion constant: A real coefficient and three imaginary coefficients"
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "quatd[4]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantDouble.ogn | {
"ConstantDouble": {
"description": "Holds a 64 bit floating point value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "double",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantString.ogn | {
"ConstantString": {
"description": "Holds a string constant value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "string",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt4.ogn | {
"ConstantInt4": {
"description": [
"Holds a 4-component int constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "int[4]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPoint3d.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantPoint3dDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantPoint3d
{
public:
static size_t computeVectorized(OgnConstantPoint3dDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantInt2.cpp |
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantInt2Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantInt2
{
public:
static size_t computeVectorized(OgnConstantInt2Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat4.ogn | {
"ConstantFloat4": {
"description": [
"Holds a 4-component float constant."
],
"categories": ["constants"],
"scheduling": ["pure"],
"version": 1,
"inputs": {
"value": {
"type": "float[4]",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantColor3f.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantColor3fDatabase.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantColor3f
{
public:
static size_t computeVectorized(OgnConstantColor3fDatabase&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantFloat4.cpp |
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
#include <OgnConstantFloat4Database.h>
namespace omni
{
namespace graph
{
namespace nodes
{
class OgnConstantFloat4
{
public:
static size_t computeVectorized(OgnConstantFloat4Database&, size_t count)
{
return count;
}
};
REGISTER_OGN_NODE()
}
}
}
|
omniverse-code/kit/exts/omni.graph.nodes/omni/graph/nodes/ogn/nodes/constants/OgnConstantPath.ogn | {
"ConstantPath": {
"description": "Holds a path constant value",
"version": 1,
"categories": ["constants"],
"scheduling": ["pure"],
"inputs": {
"value": {
"type": "path",
"description": "The constant value",
"uiName": "Value",
"metadata": {
"outputOnly": "1"
}
}
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.