Ah - you're starting down the path of API programming there. If you haven't already taken a look at them, the basic references to start are:
http://download.autodesk.com/us/maya/2009help/API/index.html http://download.autodesk.com/us/maya/2009help/index.html?url=WS73099cc142f48755-4bc38c931187aa80bc9-32ab.htm,topicNumber=d0e633206 Also, robthebloke had a good site on stuff on the api - sadly, it died (go to robthebloke.org for a truly touching memorial)... - but happily, like a good horror movie sequel, it was brought back to life by Macey at: http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/ Also, a good book intro to the maya api is: http://www.amazon.com/Complete-Maya-Programming-Extensive-Kaufmann/dp/1558608354 Just to get you started: according to the maya docs (http://download.autodesk.com/us/maya/2009help/API/class_m_fn_fluid.html), MFnFluid can take EITHER an MObject or an MDagPath; in either case, the typical way to get access to one of these "from scratch" for us scripters is through the use of MSelectionList: import maya.OpenMaya as om import maya.OpenMayaFX as omfx selList = om.MSelectionList() selList.add("myFluidNodeName") dag = om.MDagPath() selList.getDagPath(0, dag) fluidNode = omfx.MFnFluid(dag) Good luck! - Paul On Tue, Aug 18, 2009 at 5:54 PM, holofermes<[email protected]> wrote: > > Hi! > I'm a first-poster, but a long-time-reader, so first of all > compliments to all of you guys! > I'm a MEL - Python user, and I know very little about C/C++. > I was presented with a problem a day ago, where I would have to > extrapolate data of a fluid shape, such as color, density, position, > and then bring them back to Houdini. Being able to read them in > Houdini won't be a problem (I hope). Being able to export them quickly > it's givining me headachess. > I tried to use mel to export data, and it works fine, but it just too > slow. So I started looking around and I found out that there has been > already somebody working something out > > http://groups.google.com/group/python_inside_maya/browse_thread/thread/27c9c62e0390a775/7a6af00f8339d1bf?hl=en&lnk=gst > > and > > http://groups.google.com/group/python_inside_maya/browse_thread/thread/edc6a516d10551c2/b571e9c6ef165e87?hl=en&lnk=gst > > I kind of understand how does it work, but I can't get it to work my > self. I get stuck right at the beginning. > > Questions: > > fluidNode = OpenMayaFX.MFnFluid(node) > > What is node supposed to be? > MFnFluid is supposed to get a "MDagPath const &" type. How can I get > "node" to become what MFnFluid wants? > I would like this to be working on a selection basis, so would the > "node" get a different parametrization? > I'm not sure what a MDagPath does as well. > > More to come > > Thanks, > Fabio. > > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/python_inside_maya -~----------~----~----~----~------~----~------~--~---
