Mel script?? How to write float numbers to a text file
Hi All
I want to write some attributes of my objects to a text file using Mel . The values are stored in an array named W. this is my the part of the code to do this : $exampleFileName = ( "example.txt" ); $fileId=`fopen $exampleFileName "w"`; fwrite $fileId $w[0]; fclose $fileId; but it seems that Fwrite cannot handle float numbers? Do you have any idea? Bests Tootak |
Try assigning the float number to a variable, and declare that variable as a floating point number before asking it to write and then output it to screen prior to writing it to the txt file to ensure that works...
float $w; $w = `sum command`; As an example... |
In the MEL command command ref it recommends using fprint to write to a text file.
As Chris suggested make it print the array, also if you have an int in a float array, dont know why but maya thinks its a int eventhough you tell it it's a float, you need to have the .XX after the number eg 0.0 to make a float. |
All times are GMT. The time now is 10:03 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018