Schematic View

3DS Max Plug-In SDK

Schematic View

See Also: Class IGraphObjectManager, Class IGraphNode, Class Animatable. Class SubClassList.

Overview

The Schematic View window allows 3ds max users to browse, and perform certain operations on, many of the objects that compose a 3ds max scene. Like Track Views, multiple Schematic Views can be opened within MAX, both in modeless windows and docked in viewports.

Within a Schematic View window, a subset of the set of all Animatable objects within the 3ds max scene is represented by a collection of rectangular "nodes." These nodes are organized in tree form (or directed acyclic graph). The set of objects displayed depends on the current filter settings, the hide/show state of the nodes, and which objects were added to the Schematic View during the traversal phase. Schematic View is a GlobalReferenceMaker and any time it detects a change in the structure of the 3ds max scene it performs a traversal of the scene’s object network and updates the Schematic View graph. During the traversal, the actual Animatable objects (object’s derived from Animatable) are responsible for adding themselves to the Schematic View and continuing the traversal by recursively calling SvTraverseAnimGraph(...). In practice, many objects in the scene are not added to the schematic view. In general, these omitted objects are either internal data structures that might confuse the user if displayed or they are objects whose shear quantity might overwhelm the user (vertices, for example). Furthermore, although the Schematic View requires that the represented objects be derived from Animatable, there are very few restrictions on the reference pointers between objects (called "node pointers" in this section to distinguish them from 3ds max references). In particular, node pointers need not necessarily correspond to actual 3ds max references (though in practice they usually do). This flexibility allows the schematic view to represent object relationships in a manner different from the actual internal reference relationships. This can be useful in places where the internal structure does not agree with the user’s notion of how the objects are structured (e.g., a linked list displayed as siblings under a parent node, or vice-versa).

Topology

The topology of the objects added to the schematic view must be a directed acyclic graph (DAG). Cyclic references are currently not allowed.

Currently, nodes in the schematic view are arranged in tree form even if the underlying topology is a DAG. This is accomplished by duplicating shared nodes in the DAG. The DAG is essentially "flattened" into a tree. This is also how the track view works but, as will be explained in detail later, the schematic view stores additional information about the context of "shared" nodes which allows greater insight into instance relationships in the tree (multiple objects referencing a common node).

The Schematic View API

There currently are three interfaces into the schematic view objects. IGraphObjectManager, IGraphNode, and IGraphRef. IGraphObjectManager essentially represents an instance of a schematic view window and provides methods for adding nodes and node pointers, refreshing the schematic view, accessing filter bits and updating and controlling the various editors within 3ds max in ways that are not surfaced in the general interface. IGraphNode represents a node in the schematic view graph and provides a few methods for querying information about the node. Finally, IGraphRef represents a node pointer and, currently, has no methods. Each of these three interfaces is described in greater detail below.

In addition to the three schematic view interfaces, there is a set of methods in Animatable that can be overridden, all or in part, to specialize the behavior of the schematic view node(s) which represents the Animatable object. Most of these methods are appropriately implemented for the various abstract base classes from which plug-in developers derive their classes. In most cases, there is no need for the plug-in developer to override any of these methods. All of the schematic view Animatable methods are prefixed by "Sv". In addition to the "Sv" methods, there are a half dozen or so "Sv" prefixed functions in Animatable which are called to perform various schematic view related tasks. They are implemented in Animatable instead of IGraphNode because they are more closely associated with the Animatable than with the graph node or because they are called in places where the IGraphNode and IGraphObjectManager interfaces are not available.

Taken as a whole, the three interfaces (IGraphObjectManager, IGraphNode, and IGraphRef) along with the "Sv" Animatable methods and functions represent about 95% of the complete schematic view API and 100% of the public (plug-in developer) API. The other 5% or so represents a small collection of functions scoped to the application and an interface, ISchematicView, which is used by the application code to control the schematic view window.

In general, the IGraphObjectManager, IGraphNode, and IGraphRef interfaces are not accessible to plug-ins outside of the scope of the Animatable "Sv" methods and should not be cached by the plugin.

Overview of the Chain of Events in Schematic View

The events that occur in the schematic view are either generated by the user (clicking on a node, etc.) or transmitted to the schematic view via a GlobalReferenceMaker::NotifyRefChanged(...) message.

In response to these events, the schematic view performs one or more of the "Sv" methods on the effected nodes. The IGraphObjectManager, IGraphNode, and IGraphRef interfaces are passed to the "Sv" methods where appropriate.

The "Sv" methods perform some action and/or return some value and/or call one or more methods in the passed schematic view interface(s).

For example, the user selects a modifier in the schematic view and hits the "Delete" key. In response to the delete request, the schematic view calls the "bool SvRemoveThis(IGraphObjectManager *gom, IGraphNode *gNode)" method in Modifier which, in turn, calls the "DeleteModifier(IGraphNode *gNode)" method in the IGraphObjectManager interface.