PDA

View Full Version : Mel-Gurous ?? Wave -> Face Extrusion ??


substyle
07-11-2002, 08:34 PM
Hi there,

First I want to say that this is a great Forum !
Yes, i havev leared a lot, just form reading, but now the time has come that i´ve got to ask a question ;-)

The problem I have is, that i want to link an wave-audio-file as input for the extrusion of faces at various geometric bodies, like e.g. spheres, cubes ect.

So i started in Mel to developp a script, to draw the mathematic normals of all selected faces as splines.
This way i thought to have found the best way to extrude the faces along the created splines.

This is what we came up with:

//********************** **************
global proc createFaceNormalSpline()
{
string $selection[] = `ls -sl`;
string $faceSelection[];
float $normal[];
float $startPoint[];
float $endPoint[];
string $face;
string $sel;
float $mult = 10;

for($sel in $selection)
{
select -r $sel;
ConvertSelectionToFaces ;
$faceSelection = `ls -sl -fl`;

waitCursor -st 1;
for($face in $faceSelection)
{
select -r $face;
$normal = `getNormalArray`;
$startPoint = `getFaceCenter`;
$endPoint[0] = $startPoint[0] + $normal[0] * $mult;
$endPoint[1] = $startPoint[1] + $normal[1] * $mult;
$endPoint[2] = $startPoint[2] + $normal[2] * $mult;

curve -d 1 -p $startPoint[0] $startPoint[1] $startPoint[2]
-p $endPoint[0] $endPoint[1] $endPoint[2]
-k 0 -k 1 ;
}
}
waitCursor -st 0;
}

global proc float [] getFaceCenter()
{
ConvertSelectionToVertices;
string $selection[] = `ls -sl -fl`;
string $sel;
float $center[];
float $point[];
int $i;

for($sel in $selection)
{
$point = `xform -ws -q -t $sel`;
$center[0] += $point[0];
$center[1] += $point[1];
$center[2] += $point[2];
$i++;
}
$center[0] = $center[0]/$i;
$center[1] = $center[1]/$i;
$center[2] = $center[2]/$i;

return $center;
}

global proc float [] getNormalArray()
{
string $allNormals[] = `polyInfo -fn`;
string $oneNormal;
string $tokResult[];
float $normalArray[];
clear $normalArray;
int $i = 0;

for($oneNormal in $allNormals)
{
tokenize $oneNormal "FACE_NORMAL :" $tokResult;
$normalArray[$i] = $tokResult[1];
$normalArray[$i+1] = $tokResult[2];
$normalArray[$i+2] = $tokResult[3];
$i+=3;
}
return $normalArray;
}
//********************* ***************

I think this works very well.

But now the problems came up.

How may i extract the information of the amplitude from a wave file ?? Is there a way to do this in Mel ??
Must be one, sure ...

I found a method called FFT (Fast Fourier Transform, which is the one, most audio players use e.g. Winamp ect.)
But to use it, i´d have to write a standalone programm in c++ (cause i´ve to use the dll libarys and so on)

But as you all know, when we import a file to maya, it decodes the amplitude information, which can be proved by a correct graphical display of the amplitude to the timeline.

How is this done ??
(No chance to view this by watching the "echo-command" lines)

And even if, i´ll catch these procedures, how may i link them to the extrusion ammount of the faces?

The last chance i see is to extract the Information given by FFT to a txt-file and to readd them back from there.

I´m really serching hart to find a "maya-intern" solution to that problem. (Isn´t it possible to do dll-calls from maya??)


You see, it´s a hard thing and not even easy to find a solution.

Hope anybody could give me a hint or so.

subSTYLE

P.S.: Please excuse my bad english, i`m not very used to write in english language. Hope it might get better some day.

svenip
07-11-2002, 09:16 PM
i think i saw a waveout plugin on highend or aw website which can give you this info.

substyle
07-11-2002, 09:55 PM
could you please be so kind to give me an direct link ??
already searched my ass off. found nothing. sorry.
found a "render sound" plugin but thats, some different stuff.

subSTYLE

svenip
07-11-2002, 10:04 PM
http://www.aliaswavefront.com/en/Tmpl/Maya/html/index.jhtml?page=/en/Community/Download/plug_ins/maya_nt/audiowave_nt/audiowave_nt.html

Jhonus
07-12-2002, 04:54 AM
Its a good plugin, only problem i found is that you have to refresh the directory path every time you reopen a scene using the plugin.'

The audiowave node also doesn't show up in hypergraph so its a pain to locate them especially if you 10 of them (one for each frequency range).

Then theres the matter of wiring each node up to a different attribrute.

I was thinking of building a more convenient GUI for it but I don't have the time to do it at the moment

substyle
07-12-2002, 09:34 AM
Hey thanks, thats gereat !

Excatly what i searched for.

@ Krugar

Well, to build a gui , thats my aim. Send me a mail when you have some time again ;-) or i´ll do when i´m finished.

subSTYLE

CGTalk Moderation
01-13-2006, 11:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.