Most ArtiSynth model components have properties which can be changed onscreen through the graphical interface. Properties include a diverse set of attributes ranging from stiffness and damping for AxialSprings, position and velocity for particles and rigid bodies, or whether or not a component is dynamic.
The underlying software architecture of the property interface is
described in the Properties chapter of the
Maspack Reference Manual.
To edit properties for a set of components, select the components in question, then right-click in either the viewer or the navigation panel, and select Edit properties. This will create a property panel for all properties which are common to the selected components. All typical property panel is shown in Figure 22.
Property panels are initialized with the current values of the selected components, providing a view of the current property state. A blank property value will be displayed when more than one component is selected and the corresponding property value differs across components.
Some properties are read only. In this case, the corresponding widget in the property panel will display the value but will be disabled.
Property panels are non-modal and persistent. They can be deleted by closing them or clicking the OK button. Clicking the Cancel button will cause the properties to be reset to their values at the time to panel was created.
Normally, a property panel will refresh its widget values whenever the model view is rerendered. In particular, this will happen repeatedly while simulation is running. To disable the automatic refresh, click the live updating button at the lower left of the panel.
Some properties are inheritable. The value of an inheritable property can be explicitly set or it can be inherited. If inherited, then it inherits its value from ancestor components further up the hierarchy. More specifically, if a property’s value is inherited, then the value is obtained from the nearest ancestor in which the same property exists and is explicitly set. If no such ancestor exists, then the property is set to a default value.
The inherited/explicit status of an inheritable property is controlled by an additional button placed at the left of the property widget (Figure 23). Clicking this button toggles the inherited/explicit status. If set to inherited, then the property’s value is determined from the hierarchy and the updated value is placed in the widget. Setting the value in the widget itself will cause the inheritable status to be set to explicit, and the value of inherited instances of the same property in descendant nodes will be updated accordingly.
Render properties are associated with any component that is renderable. They are defined in the class RenderProps. Because of their complexity, they are adjusted through a separate panel from the standard property panel.
To adjust the property panel for a set of components, select the components in question, using either the viewer window or navigation panel, and then right click in either the viewer or the navigation panel. Several options may appear in the context menu:
This will actually remove the render properties from the selected components (i.e., their render properties will be set to null). Nominally, this means that the components will not be rendered, unless their parents take responsibility for rendering children without render properties. The latter behavior is common for lists of particles, springs, finite elements, etc., in order to avoid the need for defining render properties in a large number of objects.
This option will appear if any of the selected objects are invisible. Selecting it will set the render properties so that all components are visible.
This option will appear if any of the selected objects are visible. Selecting it will set the render properties so that all components are invisible.
There are a large number of render property settings. Loosely speaking, they are divided into generic settings, along with those related to faces, lines, and points. How these are used depends on what is being rendered. Mesh rendering typically uses the face settings, along with the line settings to render edges if the drawEdges property is set true. Line settings are also used for rendering axial springs and the edges of FEM elements. Point settings are used for rendering any subclass of Point, including Particle and FemNode.
Not all render properties may appear in a render panel; usually, only those properties relevant to the selected components will be presented.
Whether or not the component is visible.
The transparency for polygonal faces (range 0 to 1. Default is 1, for opaque).
How polygons are shaded (FLAT, SMOOTH, METAL and NONE). For viewer implementations there may be no difference between SMOOTH and METAL.
Shininess parameter for polygons (range 0 to 128). Default is 32.
If not null, specifies the specular reflectance color.
Which polygonal faces are drawn (FRONT, BACK, FRONT_AND_BACK, NONE).
Color used for drawing faces.
Color used for drawing backs of faces. If null, faceColor is used.
If true, face edgesof the polygons are drawn explicitly.
If not null, specifies the image source file and properties for color mapping.
If not null, specifies the image source file and properties for normal mapping.
If not null, specifies the image source file and properties for bump mapping.
The color for edges.
Edge width in pixels.
How lines are drawn (CYLINDER, LINE, or SPINDLE).
The color for lines.
Line width in pixels when LINE style is selected.
Cylinder radius when CYLINDER or SPINDLE style is selected.
How points are drawn (SPHERE or POINT).
The color for points.
Point size in pixels when POINT style is selected.
Sphere radius used when SPHERE style is selected.
A typical panel for editing render properties is shown in Figure 24. Texture mapping properties, if present, are normally hidden by default and can be exposed by clicking on the expand... button.