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)¶ Get the
GeometryProducer
from aNode3D
. The new producer will be located at the root location.Returns
None
in the case of an error.Parameters: - node (
Node
) – ANode3D
or Render node. - graphState (
GraphState
) – GraphState (or None, or float frame time)
Return type: GeometryProducer
See: - node (
-
Nodes3DAPI.
GetRenderProducer
(node=None, graphState=None, useMaxSamples=False, portIndex=0, applyRenderSelectedMask=True)¶ Get the renderable
GeometryProducer
from aNode3D
. The new producer will be located at the root location.The renderable producer has additional operations applied that resolve necessary attributes on the producer. This includes things like texture, material, and constraint resolution.
Returns
None
in the case of an error.Parameters: - node (
Node
) – ANode3D
or Render node. - graphState (
GraphState
) – GraphState (or None, or float frame time)
Return type: GeometryProducer
See: - node (
-
class
GeoAPI.
GeometryProducer
¶ Bases:
object
geometry producer
-
__hash__
¶
-
__init__
¶ x.__init__(...) initializes x; see help(type(x)) for signature
-
__new__
(S, ...) → a new object with type S, a subtype of T¶
-
getAttribute
(name) → L{ScenegraphAttr}¶ Get the sampled values for the named attribute. Will return None if the requested name is not included in
getAttributeNames
.
-
getAttributeNames
() → C{list} of C{str}¶ Get the names of locally defined attributes.
-
getCacheID
() → str¶ Get a cache ID based on what created this producer. This cache value should be constant for producers generating the same output..
-
getChildByName
(name) → L{GeometryProducer}¶ Find a child {GeometryProducer}. None will be returned if no child is found. This will only match a single child item, it will not match nested children.
Parameters: name – str
-
getClient
() → Geolib3 client¶ Get the client backing this producer or None.
-
getDelimitedGlobalAttribute
(name) → C{ScenegraphAttr}¶ Get the name of a global child attribute. Use dot characters to separate levels of path hierarchy. Will return None if the attribute is not found.
Parameters: name – str
-
getDelimitedLocalAttribute
(name) → C{ScenegraphAttr}¶ Get the name of a local child attribute. Use dot characters to separate levels of path hierarchy. Will return None if the attribute is not found.
Parameters: name – str
-
getFirstChild
() → L{GeometryProducer}¶ Get the first child GeometryProducer or None.
-
getFlattenedGlobalXform
() → C{list} of C{float}¶ Returns a 16 value array representing a global (worldspace) transform matrix for the producer’s location.
-
getFnAttribute
(name) → L{FnAttribute}¶ Get the sampled values for the named attribute. Will return None if the requested name is not included in
getAttributeNames
.
-
getFullName
() → C{str}¶ Get the full name of this
GeometryProducer
from the root.See: getName
-
getGlobalAttribute
(name) → C{ScenegraphAttr}¶ Get the name of a global child attribute.
Parameters: name – str
-
getName
() → str¶ Get the name of this GeometryProducer.
See: getFullName
-
getNextSibling
() → GeometryProducer¶ Get the next sibling
GeometryProducer
or None.
-
getParent
() → L{GeometryProducer}¶ Get the parent GeometryProducer.. Returns None when this is the root producer.
-
getPotentialChildren
()¶
-
getProducerByPath
(path) → L{GeometryProducer}¶ Find a child {GeometryProducer}. None will be returned if no child is found. This will match any number of children deep,. use a slash character to separate levels of hierarchy.
Parameters: path – str
-
getRootProducer
() → L{GeometryProducer}¶ Get the root for a {GeometryProducer}. This will work if the given producer is already at the root.
-
getType
() → C{str}¶ Get the type of this GeometryProducer.
-
iterChildren
() → C{iter}¶ Get an iterator for all children.
-