Panda3D
|
00001 // Filename: mayaBlendDesc.h 00002 // Created by: drose (10Feb04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef MAYABLENDDESC_H 00016 #define MAYABLENDDESC_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "referenceCount.h" 00021 #include "pointerTo.h" 00022 #include "namable.h" 00023 00024 #include "pre_maya_include.h" 00025 #include <maya/MFnBlendShapeDeformer.h> 00026 #include "post_maya_include.h" 00027 00028 class EggTable; 00029 class EggSAnimData; 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Class : MayaBlendDesc 00033 // Description : A handle to a Maya blend shape description. This is 00034 // just one target of a Maya BlendShape object, and 00035 // thus corresponds more or less one-to-one with a 00036 // single Egg morph target. (We don't attempt to 00037 // support Maya's chained target shapes here; should we 00038 // need to later, it would mean breaking each of those 00039 // target shapes on the one continuous Maya slider into 00040 // a separate MayaBlendDesc object, and synthesizing the 00041 // egg slider values appropriately.) 00042 //////////////////////////////////////////////////////////////////// 00043 class MayaBlendDesc : public ReferenceCount, public Namable { 00044 public: 00045 MayaBlendDesc(MFnBlendShapeDeformer deformer, int weight_index); 00046 ~MayaBlendDesc(); 00047 00048 void set_slider(PN_stdfloat value); 00049 PN_stdfloat get_slider() const; 00050 00051 private: 00052 void clear_egg(); 00053 00054 MFnBlendShapeDeformer _deformer; 00055 int _weight_index; 00056 00057 EggSAnimData *_anim; 00058 00059 public: 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 ReferenceCount::init_type(); 00065 Namable::init_type(); 00066 register_type(_type_handle, "MayaBlendDesc", 00067 ReferenceCount::get_class_type(), 00068 Namable::get_class_type()); 00069 } 00070 00071 private: 00072 static TypeHandle _type_handle; 00073 00074 friend class MayaNodeTree; 00075 }; 00076 00077 #endif