VMD importer: Empty object used for Camera is not named "MMD_Camera"
iRi-E opened this issue · comments
iRi-E commented
README.md says:
カメラはMMD_Cameraという名前のEmptyオブジェクトを生成し、このオブジェクトにモーションをアサインします。
However, the actual result is:
The empty object is named "Camera", while the original camera object is renamed to "Camera_mmd".
mmd_camera.py should be modified as follows:
diff --git a/mmd_tools/mmd_camera.py b/mmd_tools/mmd_camera.py
index 2b5a0cb..3f53598 100644
--- a/mmd_tools/mmd_camera.py
+++ b/mmd_tools/mmd_camera.py
@@ -61,8 +61,7 @@ class MMDCamera:
if MMDCamera.isMMDCamera(cameraObj):
return MMDCamera(cameraObj)
- name = cameraObj.name
- cameraObj.name = name + '_mmd'
+ name = 'MMD_' + cameraObj.name
empty = bpy.data.objects.new(name=name, object_data=None)
bpy.context.scene.objects.link(empty)
To keep consistency, mmd_lamp.py also should be modified:
diff --git a/mmd_tools/mmd_lamp.py b/mmd_tools/mmd_lamp.py
index 0bfb2ff..0e5486f 100644
--- a/mmd_tools/mmd_lamp.py
+++ b/mmd_tools/mmd_lamp.py
@@ -56,11 +56,11 @@ class MMDLamp:
if MMDLamp.isMMDLamp(lampObj):
return MMDLamp(lampObj)
- name = lampObj.name + '_mmd_target'
+ name = 'MMD_' + lampObj.name + '_target'
empty = bpy.data.objects.new(name=name, object_data=None)
bpy.context.scene.objects.link(empty)
- name = lampObj.name + '_mmd_source'
+ name = 'MMD_' + lampObj.name + '_source'
armature = bpy.data.armatures.new(name=name)
armatureObj = bpy.data.objects.new(name=name, object_data=armature)
bpy.context.scene.objects.link(armatureObj)