User avatar
By deadalvs
#239664
yo.

i get an error with MEL...

when i want to query all normals of a mesh, i use:

string $pi[] = `polyInfo -fn $eachFace`;
-->

//Result: FACE_NORMAL 5: -1.000 0.000 0.000

even though the object has been rotated.
it seems the normal is given out in local space, not world space... what could i do ??

* * *

thx.
User avatar
By deadalvs
#239686
the solution from cg-talk ...
//create a test plane
$plane = `polyPlane -ax 0 1 0`;
setAttr ($plane[0]+".rz") -90;

string $pi[] = `polyInfo -fn ($plane[0]+".f[0]")`;
string $buf[];
$numTokens = `tokenize $pi[0] " " $buf`;

//cast string to float
float $normal[];
$normal[0] = $buf[2];
$normal[1] = $buf[3];
$normal[2] = $buf[4];

$m = `xform -q -ws -m $plane[0]`;
float $worldspaceVec[] = pointMatrixMult($normal, $m);

normalize($worldspaceVec);
print ($worldspaceVec);
Sketchup 2025 Released

Thank you Fernando!!!!!!!!!!!!!!!!!!!!!!!!!!! hwol[…]

I've noticed that "export all" creates l[…]

hmmm can you elaborate a bit about the the use of […]

render engines and Maxwell

Funny, I think, that when I check CG sites they ar[…]