Jump to content

maya particles to houdini


Recommended Posts

Actually I think you need to write some MEL and spit out the particle positions to a text file and then either parse that into a temp Geo format or read them in with a File CHOP and Channel SOP em some points into position et al.

This is because Maya does not treat particles as just "special points" the same way that Houdini does. However - be enouraged because I've seen Maya people write such scripts in 20 minutes and have them pretty reliable.

But, no, no easy easy way.

Link to comment
Share on other sites

Actually I think you need to write some MEL and spit out the particle positions to a text file and then either parse that into a temp Geo format or read them in with a File CHOP and Channel SOP em some points into position et al.

MEL !?!

BAH! :P

Looks like a job for a "Pathologically Eclectic Rubbish Lister".

First, to get the PDA files.

From inside of maya export out the particles using "dynExport"

MAKE SURE YOU EXPORT OUT THE POSITION DATA

so something like:

dynExport -atr position -atr velocity -atr mass -f pda -mnf 1 -mxf 10 particle1

To run the perl script use something like:

cat myparticles.PDA | perl M2Hpart.pl > myparticles.geo

or on windows

more myparticles.PDA | perl M2Hpart.pl > myparticles.geo

The script will convert whatever Maya particle attributes you have into Houdini point attributes. There isn't any error checking because all 3D software outputs perfect data. :rolleyes: I did try it with a few different pda files I managed to dig up and it worked on Windows and Linux.

I had to send half a dozen emails to one of my less fortunate Maya using friends in order to get few test PDA files. <_<

"Dahhh...I animator....what is a paartickle?" :P

I tested it out pretty good, and it works for me, which means it won't work at all for you...just because. :P

#!/usr/bin/perl -w

use strict;

# Attribute Names

my @attributes;

# Types of the Attributes

my @types;

# Point Data

my @data;

# Number of Particles

my $num = 0;

# Index of Position Attribute

my $positionIndex = 0;

# Lame counter

my $var = 0;

# Index where Position starts in data line

my $posStart = 0;

while (<>) {

#############

# Read Header

#############

# Get Attributes on second line

if ($. == 2) {

Link to comment
Share on other sites

Damn....it takes me an hour just to remember the syntax for whatever language I'm using.

That's why you learn one really well, and stay with it. I'm a QBasic man and I'm sticking with it, come hell or high water.... aahhh, the sheer beauty of 'run', 'list' and 'goto line #'. I dabbled in PASCAL for a bit, but I didn't like the taint it put on my BASIC knowledge...

Cheers

Marc :P

P.S. Sorry for hijacking the thread :D

Link to comment
Share on other sites

I'm a QBasic man and I'm sticking with it, come hell or high water.... aahhh, the sheer beauty of 'run', 'list' and 'goto line #'.

HOLY COW!!

I never knew how great QBasic was.

For example this amazing program is a hamburger stand simulator!

Hamburger Stand

And to think people pay for games like the Sims when there are free ones like this.

:P

OK, back to work.

jim.

Link to comment
Share on other sites

For some odd reason QBasic kinda reminds me of Logo.

TURTLE MOVE! I command you!

jim.

As Alan Kapler (from DD) says, "Logo is the way of the future. Soon all programs will be written this way."

I'm still laughing.

Link to comment
Share on other sites

Hi,

the perl script works fine, but I have some question.

-- In Maya I use a script to control position, velocity,radiusPP,

the exporting works with position,velocity and not with radiusPP, right?

I render the particles in Renderman as riSphere. Can I do the same thing in Houdini?

Maybe is better to rewrite my expressions directly in Houdini, right?

I'm a newbie with Houdini, so can anyone explain me how I can

rewrite my expressions particles in Houdini.

-- When I import to Gplay the geo file done by perl script I cannot see any particles, why? My mistake? In the geo file I can see the correct info, partilces coord, velocity etc... I work with Houdini 6.

-- The perl scritp does or better dynExport does many files, one for each frames, so I have to import a single frame-XXX.geo file then render it, then import next frame file and render it and again and again .... , right? Can I automate all? Sorry for the stupid question.

Bye and thx again

Giuseppe

Link to comment
Share on other sites

-- In Maya I use a script to control position, velocity,radiusPP,

the exporting works with position,velocity and not with radiusPP, right?

Any Per particle attribute should work. If the attribute gets dumbed to the PDA file then it will work. :D Best way to find out is use dynExport and open the pda file in a text editor.

I render the particles in Renderman as riSphere. Can I do the same thing in Houdini?

Maybe is better to rewrite my expressions directly in Houdini, right?

Use the Copy SOP. Connect a sphere to "Input 1". Connect a File SOP with the particles to "Input 2". Use Copy Stamping in the Copy SOP to set each sphere to a different size based on the radiusPP attribute.

When I import to Gplay the geo file done by perl script I cannot see any particles, why? My mistake? In the geo file I can see the correct info, partilces coord, velocity etc... I work with Houdini 6.

The particles are only point position. In order to see geometry you need to instance/copy/etc some onto it. Or you could turn on point display.

The perl scritp does or better dynExport does many files, one for each frames, so I have to import a single frame-XXX.geo file then render it, then import next frame file and render it and again and again .... , right? Can I automate all? Sorry for the stupid question.

Bye and thx again

The Perl script is more or less a filter. The best way to do a bunch of frames is to write a little shell script. For example, in Windows, go to the directory with the particles and type

for %i in (*.pda) do more %i | perl M2Hpart.pl &gt; %~ni.geo

That loops through every .pda file in the directory, prints the contents of each file to stdout via "more". From there the perl scripts filters the output and then stores it as a file with the same name as before but with .geo as the file extentsion.

Then with the File SOP use myFilename.$F.geo

That should keep you busy for a while. :P

jim.

Link to comment
Share on other sites

Hi,

[best way to find out is use dynExport and open the pda file in a text editor.]

Done, sure :)

[use the Copy SOP. Connect a sphere to "Input 1". Connect a File SOP with the particles to "Input 2". Use Copy Stamping in the Copy SOP to set each sphere to a different size based on the radiusPP attribute.

]

Can I do the same with metaballs? I mean control the metaballs radius too.

[That should keep you busy for a while. ]

Oh sure and thanks again for the right help!

Bye

Giuseppe

PS_ I'll come back! B)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...