inventor
module inventor - Open Inventor 3D Toolkit
This module provides capabilities to work with Inventor scene objects. It- FieldContainer: Base class for all scene objects.
- Node: Generic scene object class for nodes.
- Engine: Generic scene object class for engines.
- SceneManager: Utility class for visualizing and interacting with scene graphs.
- Sensor: Utility class for observing node, field or time changes.
- Field: Represents a field instance (needed for connections).
- EngineOutput: Represents an output (needed for connections).
- Path: Represents a traversal path (return type of search and pick methods).
- NodekitCatalog: Describes notekit catalog entries.
Functions:
implements the following classes:
classes(...)
Returns all class names registered as Inventor scene objects.Args:
-
Type name of base class to filter for (optional).
Returns:
-
Type names of all classes matching the given filter.
create_classes(...)
Creates Python classes for all registered Inventor scene objects.create_object(...)
Creates a scene object instance for a given type, scene object name or existing native pointer.Args:
- type: Scene object type of instance to be created (string).
- name: Name of existing scene object to represented.
- pointer: Native pointer of existing scene object to represented.
Returns:
-
Scene object instance or None.
pick(...)
Performs an intersection test of a ray with objects in a scene.Args:
- applyTo: Node or SceneManager where action is applied.
- x, y: Viewport position of ray.
- width, height: Viewport size.
- start,direction: Start and direction vector of ray.
- near, far: Near and far distance for ray intersection tests.
- pickAll: If true returns all objects that intersect with ray. By default only first intersection is returned.
Returns:
-
List of points, normals and paths for each intersected object.
process_queues(...)
Processes inventor timer and delay queues.Args:
-
Boolean flag indicating if application is idle.
read(...)
Reads a scene graph from string or file.Args:
-
String containing scene itself or file path.
Returns:
-
Root node of scene or None on failure.
render_buffer(...)
Renders a scene into an offscreen buffer using the inventor SoOffscreenRenderer class. Note that this class creates a private, none-shared OpenGL context. If you are using a GUI framework such as Qt then it is better to do the offscreen rendering with classes like QtOpenGL.QGLFramebufferObject because the application controls the setup of the OpenGL context.Args:
- applyTo: Node or SceneManager where render action is applied.
- width, height: Viewport size.
- components: LUMINANCE = 1, LUMINANCE_TRANSPARENCY = 2, RGB = 3, RGB_TRANSPARENCY = 4
- file: Optional file name to write image buffer into.
- background: Background color. Provide two colors for gradient.
Returns:
-
Pixel buffer of rendered scene.
render_image(...)
Same as render_buffer() only that the returned buffer is wrapped in an Image object of the Python Imaging Library (PIL).Args:
- applyTo: Node or SceneManager where render action is applied.
- width, height: Viewport size.
- components: LUMINANCE = 1, LUMINANCE_TRANSPARENCY = 2, RGB = 3, RGB_TRANSPARENCY = 4
- file: Optional file name to write image buffer into.
- background: Background color. Provide two colors for gradient.
Returns:
-
Image of rendered scene.
search(...)
Searches for children in a scene with given name or type.Args:
- applyTo: Node where action is applied.
- type: Search for nodes of given type.
- node: Search for a specific node in the scene.
- name: Search for node of given name.
- searchAll: If True search includes children that are normally not traversed (hidden by switch).
- first: If true search returns only the first child found that matches the search criteria. Otherwise all matching children are returned. The default is True.
Returns:
-
List of paths matching search criteria or single path to matching
node if first is set to true.
write(...)
Writes scene graph to file or string.Args:
- applyTo: Node where action is applied.
- file: Path to file into which scene is written.
Returns:
-
Written scene as string or None is file argument was provided.