Panda3D
mayaBlendDesc.h
1 // Filename: mayaBlendDesc.h
2 // Created by: drose (10Feb04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef MAYABLENDDESC_H
16 #define MAYABLENDDESC_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "referenceCount.h"
21 #include "pointerTo.h"
22 #include "namable.h"
23 
24 #include "pre_maya_include.h"
25 #include <maya/MFnBlendShapeDeformer.h>
26 #include <maya/MObject.h>
27 #include "post_maya_include.h"
28 
29 class EggTable;
30 class EggSAnimData;
31 
32 ////////////////////////////////////////////////////////////////////
33 // Class : MayaBlendDesc
34 // Description : A handle to a Maya blend shape description. This is
35 // just one target of a Maya BlendShape object, and
36 // thus corresponds more or less one-to-one with a
37 // single Egg morph target. (We don't attempt to
38 // support Maya's chained target shapes here; should we
39 // need to later, it would mean breaking each of those
40 // target shapes on the one continuous Maya slider into
41 // a separate MayaBlendDesc object, and synthesizing the
42 // egg slider values appropriately.)
43 ////////////////////////////////////////////////////////////////////
44 class MayaBlendDesc : public ReferenceCount, public Namable {
45 public:
46  MayaBlendDesc(MFnBlendShapeDeformer &deformer, int weight_index);
47  ~MayaBlendDesc();
48 
49  void set_slider(PN_stdfloat value);
50  PN_stdfloat get_slider() const;
51 
52 private:
53  void clear_egg();
54 
55  MFnBlendShapeDeformer _deformer;
56  int _weight_index;
57 
58  EggSAnimData *_anim;
59 
60 public:
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64  static void init_type() {
65  ReferenceCount::init_type();
66  Namable::init_type();
67  register_type(_type_handle, "MayaBlendDesc",
68  ReferenceCount::get_class_type(),
69  Namable::get_class_type());
70  }
71 
72 private:
73  static TypeHandle _type_handle;
74 
75  friend class MayaNodeTree;
76 };
77 
78 #endif
A handle to a Maya blend shape description.
Definition: mayaBlendDesc.h:44
Describes a complete tree of maya nodes for conversion.
Definition: mayaNodeTree.h:40
Corresponding to an <S$Anim> entry, this stores a single column of numbers, for instance for a morph ...
Definition: eggSAnimData.h:28
A base class for all things which can have a name.
Definition: namable.h:29
This corresponds to a.
Definition: eggTable.h:31
A base class for all things that want to be reference-counted.
void set_slider(PN_stdfloat value)
Moves the Maya slider associated with this blend shape to the indicated value.
PN_stdfloat get_slider() const
Returns the current position of the Maya slider associated with this blend shape. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85