OSDN Git Service

fix bl24 encoding.
[meshio/meshio.git] / swig / pmd.i
index b75ef33..d2325f8 100644 (file)
@@ -1,4 +1,11 @@
 %module pmd
+
+///////////////////////////////////////////////////////////////////////////////
+// bytearray typemap
+///////////////////////////////////////////////////////////////////////////////
+%include <pybuffer.i>
+%pybuffer_string(const char *src);
+
 %{
 #include <pmd.h>
 using namespace meshio;
@@ -24,13 +31,6 @@ using namespace pmd;
 %template(PBoneVector) std::vector<meshio::pmd::Bone*>;
 
 ///////////////////////////////////////////////////////////////////////////////
-// bytearray typemap
-///////////////////////////////////////////////////////////////////////////////
-%include <pybuffer.i>
-%pybuffer_string(const char *src);
-%pybuffer_string(const char *path);
-
-///////////////////////////////////////////////////////////////////////////////
 // meshio::pmd::IO::each_vertex
 ///////////////////////////////////////////////////////////////////////////////
 %inline %{
@@ -130,5 +130,17 @@ 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());
+}
+
 }