Previous Thread  Next Thread

chat icon maya animation files into blender for fur

ricshal

Posted: Tue Mar 16, 2010 7:43 pm
Joined: 16 Mar 2010
Posts: 1
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.
Reply with quote


MadMesh

Posted: Tue Mar 16, 2010 9:30 pm
Joined: 17 Mar 2004
Posts: 90
I dont know if Blender is better for fur or rendering. I would love to have Mental Ray in Blender the way it is in Maya.

Anyway, getting a fully rigged and animated model from Maya to Blender is damn near impossible. FBX comes to mind, but Blender can only export to that format.
Reply with quote


P4blo Solís

Posted: Wed Mar 17, 2010 1:54 am
Joined: 12 Mar 2010
Posts: 5
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...
Reply with quote


surfingusa

Posted: Sun Jul 11, 2010 5:13 am
Joined: 11 Jul 2010
Posts: 1
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.


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?
Reply with quote


Guillaume22

Posted: Tue Dec 14, 2010 10:58 am
Joined: 24 Sep 2009
Posts: 3
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
Code:

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:

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
Reply with quote


Alessio

Posted: Tue Jun 28, 2011 3:20 pm
Joined: 28 Jun 2011
Posts: 5
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?
Reply with quote


Alessio

Posted: Tue Jun 28, 2011 3:23 pm
Joined: 28 Jun 2011
Posts: 5
I use Maya 2011 and Blender 2.58.
are not very good with scripts so I have trouble understanding

am an Italian boy
Reply with quote


Guillaume22

Posted: Tue Jul 26, 2011 11:42 am
Joined: 24 Sep 2009
Posts: 3
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
Code:

//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);
}


If you are a Windows User
Code:

//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);
}


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 :
Code:
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))


For windows users :
Code:

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))


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.

+
_________________
Guillaume
Reply with quote


enzyme69

Posted: Mon Feb 20, 2012 11:46 pm
Joined: 01 Jun 2011
Posts: 2
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/02/pipeline-interoperability-between.html
http://blendersushi.blogspot.com.au/2012/02/pipeline-mdd-import-export-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/downloads/scripts-plugins/dynamics/c/maya-to-houdini-particles-mdd-obj-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.
Reply with quote


enzyme69

Posted: Tue Feb 21, 2012 2:29 am
Joined: 01 Jun 2011
Posts: 2
@Guillaume
I think your MEL script has typo and you gotta fix few lines, how about

Code:
//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);
}
Reply with quote


electronicpulse

Posted: Thu Jan 03, 2013 9:42 pm
Joined: 19 Aug 2009
Posts: 1
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!
_________________
success comes in cans, not can'ts
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group