Panda3D
Loading...
Searching...
No Matches
maya_funcs.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file maya_funcs.h
10 * @author drose
11 * @date 2000-02-16
12 */
13
14#ifndef MAYA_FUNCS_H
15#define MAYA_FUNCS_H
16
17#include "pandatoolbase.h"
18#include "luse.h"
19#include "config_maya.h"
20
21#include "pre_maya_include.h"
22#include <maya/MFnAttribute.h>
23#include <maya/MPlug.h>
24#include <maya/MStatus.h>
25#include <maya/MFnDependencyNode.h>
26#include <maya/MObject.h>
27#include <maya/MString.h>
28#include <maya/MVector.h>
29#include "post_maya_include.h"
30
31
32bool
33get_maya_plug(MObject &node, const std::string &attribute_name, MPlug &plug);
34
35bool
36is_connected(MObject &node, const std::string &attribute_name);
37
38template<class ValueType>
39bool
40get_maya_attribute(MObject &node, const std::string &attribute_name,
41 ValueType &value);
42
43template<class ValueType>
44bool
45set_maya_attribute(MObject &node, const std::string &attribute_name,
46 ValueType &value);
47
48bool
49has_attribute(MObject &node, const std::string &attribute_name);
50
51bool
52remove_attribute(MObject &node, const std::string &attribute_name);
53
54bool
55get_bool_attribute(MObject &node, const std::string &attribute_name,
56 bool &value);
57
58bool
59get_angle_attribute(MObject &node, const std::string &attribute_name,
60 double &value);
61
62bool
63get_vec2_attribute(MObject &node, const std::string &attribute_name,
64 LVecBase2 &value);
65
66bool
67get_vec3_attribute(MObject &node, const std::string &attribute_name,
68 LVecBase3 &value);
69
70bool
71get_vec2d_attribute(MObject &node, const std::string &attribute_name,
72 LVecBase2d &value);
73
74bool
75get_vec3d_attribute(MObject &node, const std::string &attribute_name,
76 LVecBase3d &value);
77
78bool
79get_mat4d_attribute(MObject &node, const std::string &attribute_name,
80 LMatrix4d &value);
81
82void
83get_tag_attribute_names(MObject &node, pvector<std::string> &tag_names);
84
85bool
86get_enum_attribute(MObject &node, const std::string &attribute_name,
87 std::string &value);
88
89bool
90get_string_attribute(MObject &node, const std::string &attribute_name,
91 std::string &value);
92
93bool
94set_string_attribute(MObject &node, const std::string &attribute_name,
95 const std::string &value);
96
97void
98describe_maya_attribute(MObject &node, const std::string &attribute_name);
99
100bool
101describe_compound_attribute(MObject &node);
102
103std::string
104string_mfndata_type(MFnData::Type type);
105
106void
107list_maya_attributes(MObject &node);
108
109// Also, we must define some output functions for Maya objects, since we can't
110// use those built into Maya (which forward-defines the ostream type
111// incorrectly).
112INLINE std::ostream &operator << (std::ostream &out, const MString &str);
113INLINE std::ostream &operator << (std::ostream &out, const MVector &vec);
114
115#include "maya_funcs.I"
116#include "maya_funcs.T"
117
118#endif
This is our own Panda specialization on the default STL vector.
Definition pvector.h:42
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_enum_attribute(MObject &node, const std::string &attribute_name, std::string &value)
Extracts the enum attribute from the MObject as a string value.
bool is_connected(MObject &node, const std::string &attribute_name)
Returns true if the named connection exists on the node and is connected to anything,...
void describe_maya_attribute(MObject &node, const std::string &attribute_name)
Writes some warning output about the indicated Maya attribute.
bool get_string_attribute(MObject &node, const std::string &attribute_name, std::string &value)
Extracts the named string attribute from the MObject.
bool get_mat4d_attribute(MObject &node, const std::string &attribute_name, LMatrix4d &value)
Extracts the named 4x4 matrix from the MObject.
bool set_string_attribute(MObject &node, const std::string &attribute_name, const std::string &value)
Sets the named string attribute on the MObject.
bool get_angle_attribute(MObject &node, const std::string &attribute_name, double &value)
Extracts the named angle in degrees from the MObject.
void list_maya_attributes(MObject &node)
Writes some info output showing all the attributes on the given dependency node.
bool remove_attribute(MObject &node, const std::string &attribute_name)
Removes the named attribute from the indicated Maya node.
bool get_vec2d_attribute(MObject &node, const std::string &attribute_name, LVecBase2d &value)
Extracts the named two-component vector from the MObject.
bool get_maya_plug(MObject &node, const std::string &attribute_name, MPlug &plug)
Gets the named MPlug associated, if any.
bool has_attribute(MObject &node, const std::string &attribute_name)
Returns true if the node has the indicated attribute, false otherwise.
bool describe_compound_attribute(MObject &node)
Extracts the children of this attribute from the MObject.
void get_tag_attribute_names(MObject &node, pvector< std::string > &tag_names)
artists should be able to set arbitrary tags.
bool get_bool_attribute(MObject &node, const std::string &attribute_name, bool &value)
Extracts the named boolean attribute from the MObject.
bool get_vec2_attribute(MObject &node, const std::string &attribute_name, LVecBase2 &value)
Extracts the named two-component vector from the MObject.
bool get_vec3d_attribute(MObject &node, const std::string &attribute_name, LVecBase3d &value)
Extracts the named three-component vector from the MObject.
bool get_vec3_attribute(MObject &node, const std::string &attribute_name, LVecBase3 &value)
Extracts the named three-component vector from the MObject.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.