Panda3D
mayaBlendDesc.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 mayaBlendDesc.h
10  * @author drose
11  * @date 2004-02-10
12  */
13 
14 #ifndef MAYABLENDDESC_H
15 #define MAYABLENDDESC_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "referenceCount.h"
20 #include "pointerTo.h"
21 #include "namable.h"
22 
23 #include "pre_maya_include.h"
24 #include <maya/MFnBlendShapeDeformer.h>
25 #include <maya/MObject.h>
26 #include "post_maya_include.h"
27 
28 class EggTable;
29 class EggSAnimData;
30 
31 /**
32  * A handle to a Maya blend shape description. This is just one target of a
33  * Maya BlendShape object, and thus corresponds more or less one-to-one with a
34  * single Egg morph target. (We don't attempt to support Maya's chained
35  * target shapes here; should we need to later, it would mean breaking each of
36  * those target shapes on the one continuous Maya slider into a separate
37  * MayaBlendDesc object, and synthesizing the egg slider values
38  * appropriately.)
39  */
40 class MayaBlendDesc : public ReferenceCount, public Namable {
41 public:
42  MayaBlendDesc(MFnBlendShapeDeformer &deformer, int weight_index);
43  ~MayaBlendDesc();
44 
45  void set_slider(PN_stdfloat value);
46  PN_stdfloat get_slider() const;
47 
48 private:
49  void clear_egg();
50 
51  MFnBlendShapeDeformer _deformer;
52  int _weight_index;
53 
54  EggSAnimData *_anim;
55 
56 public:
57  static TypeHandle get_class_type() {
58  return _type_handle;
59  }
60  static void init_type() {
61  ReferenceCount::init_type();
62  Namable::init_type();
63  register_type(_type_handle, "MayaBlendDesc",
64  ReferenceCount::get_class_type(),
65  Namable::get_class_type());
66  }
67 
68 private:
69  static TypeHandle _type_handle;
70 
71  friend class MayaNodeTree;
72 };
73 
74 #endif
A handle to a Maya blend shape description.
Definition: mayaBlendDesc.h:40
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Describes a complete tree of maya nodes for conversion.
Definition: mayaNodeTree.h:37
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Corresponding to an <S$Anim> entry, this stores a single column of numbers, for instance for a morph ...
Definition: eggSAnimData.h:25
A base class for all things which can have a name.
Definition: namable.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This corresponds to a.
Definition: eggTable.h:27
A base class for all things that want to be reference-counted.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.