Cooking with Producers

Producers are objects that cook the scene graph from a particular node. There are two kinds of producers available in Katana – geometry producers and render producers – which correspond to having implicit resolvers disabled or enabled.

API Reference

Nodes3DAPI.GetGeometryProducer(node=None, graphState=None, portIndex=0)

Creates and returns a geometry producer for a node.

The new producer will represent the B{/root} location.

Calls Nodes3DAPI.GetOp() with the given arguments to obtain the Op with which to configure the Geolib3 Client that is passed to the initializer of the FnGeolibProducers.GeometryProducer class.

Return type

FnGeolibProducers.GeometryProducer or None

Parameters
  • node (NodegraphAPI.Node or None) – The node for which to create a geometry producer, or None to create a geometry producer for the node from which the scene is currently being viewed.

  • graphState (NodegraphAPI.GraphState or float or None) – The graph state or frame timea for which to obtain an Op that is to be used in creating the geometry producer, or None to use the current graph state.

  • portIndex (int) – The index of the port on the node for which to obtain an Op that is to be used in creating the geometry producer.

Returns

A geometry producer that represents the B{/root} location that is generated by the nodes that end in the given node or the view node.

Raises

TypeError – If the given node or graphState object is not of the expected type.

See

GetRenderProducer()

Nodes3DAPI.GetRenderProducer(node=None, graphState=None, useMaxSamples=False, portIndex=0, applyRenderSelectedMask=True)

Creates and returns a renderable geometry producer for a node.

The new producer will represent the B{/root} location.

Calls Nodes3DAPI.GetRenderOp() with the given arguments to obtain the Op with which to configure the Geolib3 Client that is passed to the initializer of the FnGeolibProducers.GeometryProducer class.

A renderable geometry producer has additional Ops applied that resolve necessary attributes on the producer. This includes things like texture, material, and constraint resolution.

Return type

FnGeolibProducers.GeometryProducer or None

Parameters
  • node (NodegraphAPI.Node or None) – The node for which to create a geometry producer, or None to create a geometry producer for the node from which the scene is currently being viewed.

  • graphState (NodegraphAPI.GraphState or float or None) – The graph state or frame timea for which to obtain an Op that is to be used in creating the geometry producer, or None to use the current graph state.

  • useMaxSamples (bool) – Flag that controls whether the scene is cooked with multiple time samples.

  • portIndex (int) – The index of the port on the node for which to obtain an Op that is to be used in creating the geometry producer.

  • applyRenderSelectedMask (bool) – Flag that controls whether the state of the global B{Render Only Selected Objects} toggle should be respected.

Returns

A renderable geometry producer that represents the B{/root} location that is generated by the nodes that end in the given node or the view node, or None if a renderable geometry producer could not be created.

Raises

TypeError – If the given node or graphState object is not of the expected type.

See

GetGeometryProducer()

class FnGeolibProducers.GeometryProducer

Bases: pybind11_builtins.pybind11_object

Geometry producer

__init__(producerType: str, **kwargs)None

Constructs a GeometryProducer of the given type. Keyword arguments must be given to pass to the initializer for the desired producer type.

getAttribute(name: str)PyFnAttribute.Attribute

Gets the sampled values for the named attribute of this GeometryProducer as an FnAttribute, or None if the requested name is not included in the results of getAttributeNames(). Supports querying of nested names using dot dyntax to separate levels of the path hierarchy.

getAttributeNames()list

Gets the names of locally defined attributes on this GeometryProducer.

getCacheID()str

Gets a cache ID based on what created this producer. This cache value should be constant for producers generating the same output.

getChildByName(name: str)PyFnGeolibProducers.GeometryProducer

Find a child of this GeometryProducer by name, or None if there is no child of the given name. This function does not support nested child lookups.

getClient()Geolib3::internal::FnGeolib::GeolibRuntime::Client

Gets the client backing this producer, or None.

getDelimitedGlobalAttribute(name: str)PyFnAttribute.Attribute

Gets the sampled values for the named global attribute of this GeometryProducer as an FnAttribute, or None if the global attribute cannot be found. Supports querying of nested names using dot syntax to separate levels of the path hierarchy.

getDelimitedLocalAttribute(name: str)PyFnAttribute.Attribute

Gets the sampled values for the named attribute of this GeometryProducer as a FnAttribute, or None if the requested name is not included in the results of getAttributeNames(). Supports querying of nested names using dot syntax to separate levels of the path hierarchy.

getFirstChild()PyFnGeolibProducers.GeometryProducer

Gets the first child of this GeometryProducer, or None if there are no children.

getFlattenedGlobalXform()tuple

Returns a 16-element tuple containing the global (worldspace) transform for this GeometryProducer’s location.

getFnAttribute(name: str)PyFnAttribute.Attribute

Gets the sampled values for the named attribute of this GeometryProducer as an FnAttribute, or None if the requested name is not included in the results of getAttributeNames(). Supports querying of nested names using dot dyntax to separate levels of the path hierarchy.

getFullName()str

Gets the full name of this GeometryProducer from the root.

getGlobalAttribute(name: str)PyFnAttribute.Attribute

Gets the sampled values for the named global attribute of this GeometryProducer as a FnAttribute, or None if the global attribute cannot be found. Supports querying of nested names using dot syntax to separate levels of the path hierarchy.

getName()str

Gets the name of this GeometryProducer.

getNextSibling()PyFnGeolibProducers.GeometryProducer

Gets the next sibling of this GeometryProducer, or None if this is the last child of the parent.

getParent()PyFnGeolibProducers.GeometryProducer

Gets the parent of this GeometryProducer, or None if this is the root producer.

getPotentialChildren()PyFnAttribute.StringAttribute

Gets the potential children of this GeometryProducer, as a GroupAttribute indexed by child name.

getProducerByPath(path: str)PyFnGeolibProducers.GeometryProducer

Find a descendent of this GeometryProducer by path, or None if no producer can be found. This function supports nested lookups via a slash-delimited path.

getRootProducer()PyFnGeolibProducers.GeometryProducer

Gets the root of this GeometryProducer. This will return the current producer if it is already the root.

getType()str

Gets the type of this GeometryProducer.

iterChildren()PyFnGeolibProducers.GeometryProducer_childIter

Returns an iterator for all immediate children of this GeometryProducer.