maya animation files into blender for fur
Moderators: jesterKing, stiv
maya animation files into blender for fur
can maya's animated character, be put into bender for fur simulation and rendering. because blender's render is fast and better for fur simulation.
-
- Posts: 0
- Joined: Fri Mar 12, 2010 5:55 am
You can do it... http://vimeo.com/2376664
But you cant import the rig, you have to make a vertex caché and import the vertex animation to blender, there you can add hair to the character and render.
Blender hair its quite good, maya fur is a headache and even using the haircut plugin will be painful...
But you cant import the rig, you have to make a vertex caché and import the vertex animation to blender, there you can add hair to the character and render.
Blender hair its quite good, maya fur is a headache and even using the haircut plugin will be painful...
-
- Posts: 0
- Joined: Sun Jul 11, 2010 6:04 am
- Location: Wellsville, OH
Re: maya animation files into blender for fur
Is Blender compatible with the .obj files created in the older versions of Maya? I have Maya 6.0.1 that I use for creating 3D models that I import into my Battlefield 2 maps. I also use it for creating navmeshes. Is Blender suitable for this thpe of work?ricshal wrote:can maya's animated character, be put into bender for fur simulation and rendering. because blender's render is fast and better for fur simulation.
-
- Posts: 0
- Joined: Fri Sep 25, 2009 12:04 am
- Location: France
I've done it !
Hi,
I'm actually working on a studio and for my job, I need to create Smoke and used Blender.
For productivity reason, I didn't take time to make an interface (maybe next time).
So I've created this small script that export *.obj sequences from Maya, and then import it to Blender :
You'll need to paste this script to Maya script editor and change the first 3 variables :
Note : do not write .obj after the file name
Then in Blender 2.5 (do not work with 2.4 and before), paste the next script in the text editor, change the first 3 variables and Run Script
(same variable and do not write .obj after file name)
Note : Create a new file to import you obj sequence is safer.
+
I'm actually working on a studio and for my job, I need to create Smoke and used Blender.
For productivity reason, I didn't take time to make an interface (maybe next time).
So I've created this small script that export *.obj sequences from Maya, and then import it to Blender :
You'll need to paste this script to Maya script editor and change the first 3 variables :
Note : do not write .obj after the file name
Code: Select all
int $startFrame = 1;
int $endFrame = 24;
//Linux user
string $file = "/home/you/folder/file"
//Windows user (uncomment the next row and comment the previous one)
//string $file = "C:\\your\\folder\\file"
for ($i=$startFrame; $i <= $endFrame; ++$i)
{
currentTime $i;
file -op "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1" -typ "OBJexport" -pr -es ($file + $i);
}
Then in Blender 2.5 (do not work with 2.4 and before), paste the next script in the text editor, change the first 3 variables and Run Script
(same variable and do not write .obj after file name)
Note : Create a new file to import you obj sequence is safer.
Code: Select all
import bpy
startFrame = 1;
endFrame = 24;
#Linux
file = "/home/you/folder/file"
#Windows
#file = "C:\\your\\folder\\file"
i = startFrame
bpy.ops.import_scene.obj(filepath=(file + str(i) + ".obj"))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh")
bpy.ops.object.shape_key_add()
i1 = 1
while i <= endFrame:
bpy.ops.import_scene.obj(filepath=(file + str(i) + ".obj"))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh.001")
bpy.ops.object.select_name(name="Mesh")
bpy.ops.object.join_shapes()
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 0.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i-1))
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 1.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i))
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 0.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i+1))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh.001")
bpy.ops.object.delete()
i += 1
i1 += 1
bpy.data.objects["Mesh"].data.shape_keys.keys[i1 - 1].value = 1.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1 - 1].keyframe_insert("value", frame=(i))
Guillaume
Re: I've done it !
hello
I do not understand your explanation.
I am very interested in this topic.
I also work with Maya and Blender
could help me understand better?
I do not understand your explanation.
I am very interested in this topic.
I also work with Maya and Blender
could help me understand better?
Re: I've done it !
I use Maya 2011 and Blender 2.58.
are not very good with scripts so I have trouble understanding
am an Italian boy
are not very good with scripts so I have trouble understanding
am an Italian boy
-
- Posts: 0
- Joined: Fri Sep 25, 2009 12:04 am
- Location: France
Hi,
sorry for the very late answer...
And sorry for my poor english.
I'll try to explain it a bit more these scripts :
1. In Maya
Open the script editor and paste the following script :
If you are a Linux User
If you are a Windows User
Before you execute the script, change the 3 first variables :
- $startFrame = The beginning frame for the animation you want to export
- $endFrame = The last frame of this animation
- $file = Folder and file name where you want to export the .obj sequence. Do not enter .obj. Script will automatically increment and add extension (example : "/home/guillaume/export/file". Script will create file1.obj, file2.obj...). For windows, enter 2 \ to separate folders (example : C:\\Users\\guillaume\\export\\file).
Then, select the animated object you want to export. It must be a mesh.
Execute the script (CTRL+ENTER in maya script window).
2. In Blender 2.5
Create a new scene and delete all objects (camera, cube, light)
Open the text editor and paste the following script :
For Linux users :
For windows users :
As for the maya script, you need to change the first 3 variables with your scene value (startFrame, endFrame, file). These values are the same as you specify in the maya script.
Then execute the script.
During the process, Blender "freeze" but you have to wait. I suggest you to open blender with a terminal to follow the operation (in the terminal, blender says : "Importing file1.obj, importing file2.obj...).
Important : If you export/import to big mesh or to much frame at one time, you'll need a computer with lots of memory. Importing .obj sequence copy each file in memory before finishing the process. Your computer can become very slow during the process if you import a to big obj sequence.
I expect this message is more understandable.
+
sorry for the very late answer...
And sorry for my poor english.
I'll try to explain it a bit more these scripts :
1. In Maya
Open the script editor and paste the following script :
If you are a Linux User
Code: Select all
//Change the next 3 variable for your scene
int $startFrame = 1;
int $endFrame = 24;
string $file = "/home/you/folder/file"
for ($i=$startFrame; $i <= $endFrame; ++$i)
{
currentTime $i;
file -op "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1" -typ "OBJexport" -pr -es ($file + $i);
}
Code: Select all
//Change the next 3 variable for your scene
int $startFrame = 1;
int $endFrame = 24;
string $file = "C:\\your\\folder\\file"
for ($i=$startFrame; $i <= $endFrame; ++$i)
{
currentTime $i;
file -op "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1" -typ "OBJexport" -pr -es ($file + $i);
}
- $startFrame = The beginning frame for the animation you want to export
- $endFrame = The last frame of this animation
- $file = Folder and file name where you want to export the .obj sequence. Do not enter .obj. Script will automatically increment and add extension (example : "/home/guillaume/export/file". Script will create file1.obj, file2.obj...). For windows, enter 2 \ to separate folders (example : C:\\Users\\guillaume\\export\\file).
Then, select the animated object you want to export. It must be a mesh.
Execute the script (CTRL+ENTER in maya script window).
2. In Blender 2.5
Create a new scene and delete all objects (camera, cube, light)
Open the text editor and paste the following script :
For Linux users :
Code: Select all
import bpy
startFrame = 1;
endFrame = 24;
file = "/home/you/folder/file"
i = startFrame
bpy.ops.import_scene.obj(filepath=(file + str(i) + ".obj"))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh")
bpy.ops.object.shape_key_add()
i1 = 1
while i <= endFrame:
bpy.ops.import_scene.obj(filepath=(file + str(i) + ".obj"))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh.001")
bpy.ops.object.select_name(name="Mesh")
bpy.ops.object.join_shapes()
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 0.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i-1))
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 1.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i))
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 0.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i+1))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh.001")
bpy.ops.object.delete()
i += 1
i1 += 1
bpy.data.objects["Mesh"].data.shape_keys.keys[i1 - 1].value = 1.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1 - 1].keyframe_insert("value", frame=(i))
Code: Select all
import bpy
startFrame = 1;
endFrame = 24;
file = "C:\\your\\folder\\file"
i = startFrame
bpy.ops.import_scene.obj(filepath=(file + str(i) + ".obj"))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh")
bpy.ops.object.shape_key_add()
i1 = 1
while i <= endFrame:
bpy.ops.import_scene.obj(filepath=(file + str(i) + ".obj"))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh.001")
bpy.ops.object.select_name(name="Mesh")
bpy.ops.object.join_shapes()
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 0.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i-1))
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 1.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i))
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].value = 0.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1].keyframe_insert("value", frame=(i+1))
bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_name(name="Mesh.001")
bpy.ops.object.delete()
i += 1
i1 += 1
bpy.data.objects["Mesh"].data.shape_keys.keys[i1 - 1].value = 1.0
bpy.data.objects["Mesh"].data.shape_keys.keys[i1 - 1].keyframe_insert("value", frame=(i))
Then execute the script.
During the process, Blender "freeze" but you have to wait. I suggest you to open blender with a terminal to follow the operation (in the terminal, blender says : "Importing file1.obj, importing file2.obj...).
Important : If you export/import to big mesh or to much frame at one time, you'll need a computer with lots of memory. Importing .obj sequence copy each file in memory before finishing the process. Your computer can become very slow during the process if you import a to big obj sequence.
I expect this message is more understandable.
+
Guillaume
Thanks for sharing the script, Guillaume! Really clear step-by-step explanation. I stumbled into this thread somewhat and lucky to find this gem. I have been looking for Blender script that can import OBJ sequences for animation.
Recently, myself has been researching on Interoperability between Maya and Blender, I wrote some of my notes at my blog:
http://blendersushi.blogspot.com/2012/0 ... tween.html
http://blendersushi.blogspot.com.au/201 ... -demo.html
In my current conclusion, the best way is to export out animation in MDD format. Export all the OBJ required and import each vertex animation into Blender as Shapekeys via MDD.
Like I wrote on my blog, from Maya, you need to download script called MDD-OBJ-exporter:
http://www.creativecrash.com/maya/downl ... j-exporter
Similar to Guillaume's script, that script help you to export out:
1. OBJ sequence
2. MDD vertex animation
3. Particles
So the step-by-step is like this:
FROM MAYA OUT TO BLENDER
1. Export out OBJ per object you animate
2. Export out MDD per object you animate
IN BLENDER
1. Import OBJ per object
2. Import MDD per object.
Inside Blender, each animated mesh will become a Shapekey vertex animation.
If none of this explain it, I will create video tutorial.
Recently, myself has been researching on Interoperability between Maya and Blender, I wrote some of my notes at my blog:
http://blendersushi.blogspot.com/2012/0 ... tween.html
http://blendersushi.blogspot.com.au/201 ... -demo.html
In my current conclusion, the best way is to export out animation in MDD format. Export all the OBJ required and import each vertex animation into Blender as Shapekeys via MDD.
Like I wrote on my blog, from Maya, you need to download script called MDD-OBJ-exporter:
http://www.creativecrash.com/maya/downl ... j-exporter
Similar to Guillaume's script, that script help you to export out:
1. OBJ sequence
2. MDD vertex animation
3. Particles
So the step-by-step is like this:
FROM MAYA OUT TO BLENDER
1. Export out OBJ per object you animate
2. Export out MDD per object you animate
IN BLENDER
1. Import OBJ per object
2. Import MDD per object.
Inside Blender, each animated mesh will become a Shapekey vertex animation.
If none of this explain it, I will create video tutorial.
@Guillaume
I think your MEL script has typo and you gotta fix few lines, how about
I think your MEL script has typo and you gotta fix few lines, how about
Code: Select all
//Change the next 4 variables for your scene
int $startFrame = 1;
int $endFrame = 24;
string $file = "C:\\mayatmp";
string $filename = "mayaout";
for ($i=$startFrame; $i <= $endFrame; ++$i)
{
currentTime $i;
file -op "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1" -typ "OBJexport" -pr -es ($file + "/" + $filename + $i);
}
-
- Posts: 0
- Joined: Wed Aug 19, 2009 2:21 pm
Hey i've been trying to use this python exporter for maya on a mac, and it seems to work, i actually did a bouncing ball with only transformations from the transform node and it worked perfectly in blender, but once i start adding bones it goes a bit to hell with the deformations, it seems like the vertex orders change, but i don't know if it's in the OBJ or mdd, or when blender imports it.
any ideas?.
im using blender 2.65.5 and maya 2011 on OSX 10.6.8
very much appreciated!
any ideas?.
im using blender 2.65.5 and maya 2011 on OSX 10.6.8
very much appreciated!
success comes in cans, not can'ts