X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=swig%2Fpmd.i;h=f858e8b34effaf44f2824b92f2ce4968b9b0c81a;hb=4b7b856e70fe8047f985e2598020032d0d87a672;hp=ced353043b50b40fdcced54a25e2f4e16e13468d;hpb=63ab17b332851df84cc5af4c28c40fd5ed3f67ca;p=meshio%2Fmeshio.git diff --git a/swig/pmd.i b/swig/pmd.i index ced3530..f858e8b 100644 --- a/swig/pmd.i +++ b/swig/pmd.i @@ -1,4 +1,11 @@ %module pmd + +/////////////////////////////////////////////////////////////////////////////// +// bytearray typemap +/////////////////////////////////////////////////////////////////////////////// +%include +%pybuffer_string(const char *src); + %{ #include using namespace meshio; @@ -7,6 +14,7 @@ using namespace pmd; %include "std_vector.i" %include "std_wstring.i" %include "std_string.i" +%include "std_pair.i" %include "../include/color.h" %include "../include/la.h" %include "../include/pmd.h" @@ -22,6 +30,9 @@ using namespace pmd; %template(UshortVector) std::vector; %template(Vector3Vector) std::vector; %template(PBoneVector) std::vector; +%template(BoneGroupVector) std::vector; +%template(DisplayPair) std::pair; +%template(BoneDisplayVector) std::vector >; /////////////////////////////////////////////////////////////////////////////// // meshio::pmd::IO::each_vertex @@ -73,6 +84,12 @@ const meshio::pmd::Vertex* _dereferenceVertex( // addMaterial // addBone // addMorph +// addIK +// addBoneDisplay +// addBoneGroup +// getToonTexture +// addRigidBody +// addConstraint /////////////////////////////////////////////////////////////////////////////// %extend meshio::pmd::IO { @@ -106,15 +123,34 @@ meshio::pmd::IK *addIK() return &($self->ik_list.back()); } -void addBoneNameList(const std::string &name) -{ - $self->bone_display_name_list.push_back(name); -} - void addBoneDisplay(unsigned short bone_index, unsigned char display_index) { $self->bone_display_list.push_back( std::make_pair(bone_index, display_index)); } +meshio::pmd::BoneGroup *addBoneGroup() +{ + $self->bone_group_list.push_back(meshio::pmd::BoneGroup()); + return &($self->bone_group_list.back()); +} + +meshio::pmd::ToonTexture *getToonTexture(int index) +{ + return &($self->toon_textures[index]); +} + +meshio::pmd::RigidBody *addRigidBody() +{ + $self->rigidbodies.push_back(meshio::pmd::RigidBody()); + return &($self->rigidbodies.back()); +} + +meshio::pmd::Constraint *addConstraint() +{ + $self->constraints.push_back(meshio::pmd::Constraint()); + return &($self->constraints.back()); } + +} +