public:
FileWriter(const char *path);
+ FileWriter(const wchar_t *path);
virtual ~FileWriter();
virtual void write(const char *buf, unsigned int size);
};
{
char name[50];
char english_name[50];
+
+ void setName(const char *name);
+ void setEnglishName(const char *english);
};
////////////////////////////////////////////////////////////
bool read(const wchar_t *path);
bool write(binary::IWriter &writer);
bool write(const char *path);
+ bool write(const wchar_t *path);
const Vector2* getUV(int index)const;
std::wstring getName()const;
io_=fopen(path, "wb");
}
+FileWriter::FileWriter(const wchar_t *path)
+{
+ io_=_wfopen(path, L"wb");
+}
+
FileWriter::~FileWriter()
{
fclose(io_);
return write(w);
}
+bool IO::write(const wchar_t *path)
+{
+ binary::FileWriter w(path);
+ return write(w);
+}
+
const Vector2* IO::getUV(int index)const
{
return &vertices[index].uv;
}
+void BoneDisplayName::setName(const char *src)
+{
+ strncpy(name, src, 20);
+}
+
+void BoneDisplayName::setEnglishName(const char *src)
+{
+ strncpy(english_name, src, 20);
+}
+
} // namespace
} // namespace
###############################################################################
class ProgressBar(object):
def __init__(self, base):
- print "#### %s ####" % base
+ print("#### %s ####" % base)
self.base=base
self.start=Blender.sys.time()
self.set('<start>', 0)
self._print(message)
def _print(self, message):
- print message
+ print(message)
message="%s: %s" % (self.base, message)
if message.__class__ is unicode:
message=message.encode(FS_ENCODING)
import mathutils
import os
+import sys
import time
import functools
+# \e$B%U%!%$%k%7%9%F%`$NJ8;z%3!<%I\e(B
+# \e$B2~B$HG$H$N6&MQ$N$?$a\e(B
+FS_ENCODING=sys.getfilesystemencoding()
+if os.path.exists(os.path.dirname(sys.argv[0])+"/utf8"):
+ INTERNAL_ENCODING='utf-8'
+else:
+ INTERNAL_ENCODING=FS_ENCODING
+
+
###############################################################################
# ProgressBar
###############################################################################
%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 %{
}
}
+