Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

MayaDAGUtility.cpp

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Lamp : Open source game middleware
00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //------------------------------------------------------------------------------
00019 
00020 /** @file
00021  * MayaDAGユーティリティ実装
00022  * @author Junpee
00023  */
00024 
00025 #include "System/stdafx.h"
00026 #include "Utility/MayaDAGUtility.h"
00027 
00028 namespace LampForMaya{
00029 
00030 //------------------------------------------------------------------------------
00031 // 名前の取得
00032 String MayaDAGUtility::getName(const MObject& node){
00033     MStatus result;
00034     MFnDagNode dagNode(node, &result);
00035     MayaStatusCheck(result);
00036     return String(dagNode.name().asChar());
00037 }
00038 //------------------------------------------------------------------------------
00039 // 名前の取得
00040 String MayaDAGUtility::getName(const MDagPath& dagPath){
00041     MStatus result;
00042     MFnDagNode dagNode(dagPath, &result);
00043     MayaStatusCheck(result);
00044     return String(dagNode.name().asChar());
00045 }
00046 //------------------------------------------------------------------------------
00047 // フルパスの取得
00048 String MayaDAGUtility::getFullPath(const MObject& node){
00049     MStatus result;
00050     MFnDagNode dagNode(node, &result);
00051     MayaStatusCheck(result);
00052     return String(dagNode.fullPathName().asChar());
00053 }
00054 //------------------------------------------------------------------------------
00055 // フルパスの取得
00056 String MayaDAGUtility::getFullPath(const MDagPath& dagPath){
00057     MStatus result;
00058     MFnDagNode dagNode(dagPath, &result);
00059     MayaStatusCheck(result);
00060     return String(dagNode.fullPathName().asChar());
00061 }
00062 //------------------------------------------------------------------------------
00063 // プラグの取得
00064 MPlug MayaDAGUtility::getPlug(const MObject& node, const String& plugName){
00065     MStatus result;
00066     MFnDagNode dagNode(node, &result);
00067     MayaStatusCheck(result);
00068     MPlug plug = dagNode.findPlug(plugName.getBytes(), &result);
00069     MayaStatusCheck(result);
00070     return plug;
00071 }
00072 //------------------------------------------------------------------------------
00073 // プラグの取得
00074 MPlug MayaDAGUtility::getPlug(const MDagPath& dagPath, const String& plugName){
00075     MStatus result;
00076     MFnDagNode dagNode(dagPath, &result);
00077     MayaStatusCheck(result);
00078     MPlug plug = dagNode.findPlug(plugName.getBytes(), &result);
00079     MayaStatusCheck(result);
00080     return plug;
00081 }
00082 //------------------------------------------------------------------------------
00083 } // End of namespace LampForMaya
00084 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:55 2005 for LampForMaya by doxygen 1.3.2