Used for part operations.
xshade |
↑ |
shape |
↑ |
part |
clean_surface_part_polygonmesh | Deletes polygon mesh information from a curved surface |
disclose_all | Displays all contents of the selected part, including child parts |
get_plane_equation | Returns the plane equation |
realize_link | Substantializes a link |
realize_replicator | Substantializes a replicator |
reverse | Applies Reverse |
select_camera_joint | Sets a camera object to the currently active camera |
set_view | Makes the selected camera object the active camera |
setup_plane_equation | Sets up the plane equation |
setup_surface_part_polygonmesh | Sets polygon mesh information to a curved surface |
switch | Applies Switch |
undisclose_all | Hides all contents of the selected part, including child parts |
closed | Whether or not all the line objects in the part are closed line objects |
disclosed | Whether or not the part's contents are displayed in the Browser |
edge | Returns the edge object of the specified edge |
face | Returns the face object of the specified face |
flat_joint | Flat |
group | Group Selection on/off |
is_master_image | Whether or not it is a master image part |
is_master_shape | Whether or not it is a master object part |
is_master_surface | Whether or not it is a master surface part |
is_pose_joint | Whether or not it is a pose joint |
joint_blend | Joint blend |
joint_matrix | The joint transformation matrix |
link_master | The link's original object |
number_of_active_control_points | The number of selected control points |
number_of_edges | The number of edges |
number_of_faces | The number of faces |
number_of_sons | The number of objects one level below in the hierarchy |
number_of_vertices | The number of vertices |
part_type | The part type |
surface_closed | Whether or not the curved surface lateral is closed |
surface_switched | Whether or not the curved surface is switched vertically and horizontally |
transformation_matrix | The object's transformation matrix |
vertex | Returns the vertex object of the specified vertex |
view_anchor | Object Camera Translation Mode in the Motion Window |
Used after getting an object with a method such as xshade.scene().active_shape().
clean_surface_part_polygonmesh
Deletes polygon mesh information from a curved surface.
See also :
setup_surface_part_polygonmesh
xshade.scene().active_shape().clean_surface_part_polygonmesh()
disclose_all
Displays all contents of the selected part, including child parts.
See also :
undisclose_all
xshade.scene().active_shape().disclose_all()
get_plane_equation
Returns the plane equation.
Return value :
float4
Arguments :
int : the face number
See also :
setup_plane_equation
setup_surface_part_polygonmesh
Return the plane equation set with setup_plane_equationfor curved surfaces set with polygon mesh information via setup_surface_part_polygonmesh().
xshade.scene().active_shape().set_plane_equation() print xshade.scene().active_shape().get_plane_equation(0)
realize_link
Substantializes a link.
Return value :
shape
See also :
shape
#If the selected object is a link, substantialize it
xshade.scene().active_shape().realize_link()
realize_replicator
Substantializes a replicator.
Return value :
shape
See also :
shape
#If the selected object is a replicator, substantialize it
xshade.scene().active_shape().realize_replicator()
reverse
Applies Reverse.
xshade.scene().active_shape().reverse()
select_camera_joint
Sets a camera object to the currently active camera.
Only valid for camera objects.
#Make the selected camera object the active camera
camera_obj = xshade.scene().active_shape()
camera_obj. select_camera_joint()
set_view
Makes the selected camera object the active camera.
xshade.scene().active_shape().set_view()
setup_plane_equation
Sets up the plane equation.
See also :
get_plane_equation
setup_surface_part_polygonmesh
Use setup_surface_part_polygonmesh() to set curved surfaces with polygon mesh information.
xshade.scene().active_shape().setup_surface_part_polygonmesh() xshade.scene().active_shape().setup_plane_equation()
setup_surface_part_polygonmesh
Sets polygon mesh information to a curved surface.
Arguments :
int : Subdivision of the polygon mesh : 0: No subdivision, 1: Coarse, 2: Regular, 3: Fine, 4: Very fine
If omitted, "2: Regular" is used.
The following information can be gotten and set for curved surfaces:
get_plane_equation | Returns the plane equation |
setup_plane_equation | Sets up the plane equation |
edge | Returns the edge object of the specified edge |
face | Returns the face object of the specified face |
number_of_edges | The number of edges |
number_of_faces | The number of faces |
number_of_vertices | The number of vertices |
vertex | The vertex object of the specified vertex |
#Set polygon mesh information to a curved surface and output that information #If an error occurs, output the error try: s = xshade.scene().active_shape() assert s.type == 2 and s.part_type == 1, 'Select a curved surface.' if s.type == 2 and s.part_type == 1: s.setup_surface_part_polygonmesh() s.setup_plane_equation() print 'The plane equation of face 0:',s.get_plane_equation(0) print 'The coordinates of vertex 0:',s.vertex(0).position print 'The distance UV coordinates of face 0:',s.face(0).distance_uv print 'The parameter UV coordinates of face 0:',s.face(0).parameter_uv print 'Number of edges:',s.number_of_edges print 'The number of faces:',s.number_of_faces print 'The number of vertices:',s.number_of_vertices s.setup_normal() print 'The normal of vertex 0:',s.vertex(0).normal s.clean_surface_part_polygonmesh() except AssertionError, message: print message
switch
Applies Switch.
Because a line object will be regenerated when Switch is applied, the shape class pointer of the line object in the part will also change.
xshade.scene().active_shape().switch()
undisclose_all
Hides all contents of the selected part, including child parts.
See also :
disclose_all
xshade.scene().active_shape().undisclose_all()
closed
Whether or not all the line objects in the part are closed line objects.
Type :
bool
print xshade.scene().active_shape().closed
disclosed
Whether or not the part's contents are displayed in the Browser.
Type :
bool
print xshade.scene().active_shape().disclosed
edge
Returns the edge object of the specified edge.
Return value :
edge object
Arguments :
int : the edge number
See also :
edge
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().
#Output both vertices of the edge object of edge 0
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).v0
print xshade.scene().active_shape().edge(0).v1
face
Returns the face object of the specified face.
Return value :
face object
Arguments :
int : the face number
See also :
face
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().
#Output list of distance UV coordinates of the face object of face 0
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).face(0).distance_uv
flat_joint
Flat.
Type :
bool : True : Flat, False : Hierarchical
print xshade.scene().active_shape().flat_joint
group
Group Selection on/off.
Type :
bool
print xshade.scene().active_shape().group
is_master_image
Whether or not it is a master image part.
Type :
bool
print xshade.scene().active_shape().is_master_image
is_master_shape
Whether or not it is a master object part.
Type :
bool
print xshade.scene().active_shape().is_master_shape
is_master_surface
Whether or not it is a master surface part.
Type :
bool
print xshade.scene().active_shape().is_master_surface
is_pose_joint
Whether or not it is a pose joint.
Type :
bool
Determines whether the special character "|" is included in the part object name.
print xshade.scene().active_shape().is_pose_joint
joint_blend
Joint blend.
Type :
float
print xshade.scene().active_shape().joint_blend
joint_matrix
The joint transformation matrix.
Type :
mat4
print xshade.scene().active_shape().joint_matrix
link_master
The link's original object.
Type :
shape object
Only valid for link objects.
#Output the name of the link's original object
print xshade.scene().active_shape().link_master.name
number_of_active_control_points
The number of selected control points.
Type :
int
print xshade.scene().active_shape().number_of_active_control_points
number_of_edges
The number of edges.
Type :
int
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().
xshade.scene().active_shape().setup_surface_part_polygonmesh() print xshade.scene().active_shape().number_of_edges
number_of_faces
The number of faces.
Type :
int
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().
xshade.scene().active_shape().setup_surface_part_polygonmesh() print xshade.scene().active_shape().number_of_faces
number_of_sons
The number of objects one level below in the hierarchy.
Type :
int
print xshade.scene().active_shape().number_of_sons
number_of_vertices
The number of vertices.
Type :
int
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().
xshade.scene().active_shape().setup_surface_part_polygonmesh() print xshade.scene().active_shape().number_of_vertices
part_type
The part type.
Type :
int
0 | part | simple_part |
1 | curved surface | surface_part |
2 | rotator joint | rotator_joint |
3 | slider joint | slider_joint |
4 | scale joint | scale_joint |
5 | uniscale joint | uniscale_joint |
6 | light joint | light_joint |
7 | path joint | path_joint |
8 | morph joint | morph_joint |
9 | custom joint | custom_joint |
10 | ball joint | ball_joint |
11 | camera | camera_joint |
12 | sound | sound_part |
13 | switch | switch_joint |
14 | path replicator | path_replicator |
15 | surface replicator | surface_replicator |
16 | bone joint | bone_joint |
100 | master surface | master_surface_part |
101 | link | link_part |
102 | master image | master_image_part |
103 | master object | master_shape_part |
104 | master object (external reference object) | master_shape_object_part |
105 | local axis | local_axis_part |
The following properties can determine if it is a specific type of part:
part | |
curved surface | |
rotator joint | shape.is_rotator_joint |
slider joint | shape.is_slider_joint |
scale joint | shape.is_scale_joint |
uniscale joint | shape.is_uniscale_joint |
light joint | shape.is_light_effector |
path joint | shape.is_path_joint |
morph joint | shape.is_morph_effector |
custom joint | shape.is_custom_joint |
ball joint | shape.is_ball_joint |
camera | |
sound | shape.is_sound_track |
switch | shape.is_switch_effector |
path replicator | |
surface replicator | |
bone joint | shape.is_bone_joint |
master surface | shape.is_master_surface |
link | |
master image | shape.is_master_image |
master object | shape.is_master_shape |
master object (external reference object) | |
local axis |
print xshade.scene().active_shape().part_type
surface_closed
Whether or not the curved surface lateral is closed.
Type :
bool
print xshade.scene().active_shape().surface_closed
surface_switched
Whether or not the curved surface is switched vertically and horizontally.
Type :
bool
To actually switch the curved surface use switch().
By setting the 'not' value so that if True, False, and if False, True, the switch flag can be reversed without actually switching the curved surface.
Because a line object will be regenerated when Switch is applied, the shape class pointer of the line object in the part will also change.
print xshade.scene().active_shape().surface_switched
transformation_matrix
The object's transformation matrix.
Type :
mat4
Does not take joints or skin into account; simply the matrix values assigned to the object.
print xshade.scene().active_shape().transformation_matrix
vertex
Returns the vertex object of the specified vertex.
Return value :
vertex object
Arguments :
int : the vertex number
See also :
vertex
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().
#Output vertex object coordinates of vertex 0
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).vertex(0).position
view_anchor
Object Camera Translation Mode in the Motion Window.
Type :
int :
0 | Eye point and target point |
1 | Eye point |
2 | Target point |
print xshade.scene().active_shape().view_anchor