Chaos Corona Forum

General Category => Porting and API => [Archive] Chaos Corona for Maya => Topic started by: hugojackson18 on 2015-08-01, 14:12:15

Title: TX Files
Post by: hugojackson18 on 2015-08-01, 14:12:15
Hey, could someone explain to me how to create the tx files from the maketx.exe and what the correct workflow is please?

I've got a few 8k maps (4 exactly at the moment) and sometimes the render just take forever to do the first pass... I don't really know why.

Thanks!

EDIT: I've got those 4 file nodes connected to multiple shaders. Don't know if that makes a difference but just putting it up here. Should save memory normally
Title: Re: TX Files
Post by: haggi on 2015-08-02, 16:36:19
Create tx files with:
import makeTx as mk
mk.optimizeFileTextureNodes()

The translator looks for a file ending with .tx for the image file in the same locatino and if he finds one, it takes the tx file.
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-03, 15:43:40
Thanks haggi. Is this to put in the script editor? Will it create tx files out of all the files in the hypershade?

And you said something in the manual about the extension needed to be .exr. I didn't understand this part. Do the files need to be exr to be correctly converted to tx or does the tx files need to be changed to a .exr extension to be recognised?
Title: Re: TX Files
Post by: haggi on 2015-08-03, 15:55:42
Yes, this part of the manual is not yet clear.

The maketx.exe program which converts images to tx files normally works with tif files. Unfortunatly this default behaviour does not work on windows correctly, I suppose that't because of the used tiff library. So what the script does it to create an exr - tx file for ever file texture in maya. It is then called after the original name with the extension ".exr.tx", e.g. if you have a texture file called "test.jpg", the result will be test.jpg.exr.tx".

In other words: place the two lines into a python tab in the script editor and execute it. In the output windows you should see a listing which files are used and you can see if  your tx files are used as expected.
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-03, 19:57:22
Amazing thanks a lot haggi, I shall try this tonight.

What kind of performance increase are we looking at with tx files?
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-03, 21:09:45
I'm getting this error when I run the script....

In the script editor
Y:\Users\Hugo\Documents\maya\mayaToCorona\bin\makeTx.exe -v -oiio -o E:/PERSONAL PROJECTS/BEDROOM/sourceimages/stanmoreSpeaker/export_2.0/stanmore1002_specular.tif.exr E:/PERSONAL PROJECTS/BEDROOM/sourceimages/stanmoreSpeaker/export_2.0/stanmore1002_specular.tif
# Error: mtCoronaLogger : Conversion failed #

And this in the ouput window
TIFFReadDirectory: Warning, E:\PERSONAL PROJECTS\BEDROOM\sourceimages\stanmoreSpeaker\export_2.0\stanmore1002_normal.tif: wrong data type 7 for "RichTIFFIPTC"; tag ignored.
Title: Re: TX Files
Post by: haggi on 2015-08-04, 00:12:08
Hmmm... was the tx file created? That's only a warning.
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-04, 00:54:13
No nothing was created unfortunately....
Title: Re: TX Files
Post by: haggi on 2015-08-04, 11:30:44
It is possible that this has something to do with the general tif format problem. Could you please try to convert the tif file into something else, e.g. exr, tga, png and try again?
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-04, 14:55:52
I've tried with a png too, and had the same message. I'll try again tonight
Title: Re: TX Files
Post by: haggi on 2015-08-04, 15:46:28
Any chance that you can send me the file?
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-04, 15:49:38
Absolutely. I will send you some of them tonight as soon as I'm home!
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-06, 23:11:15
The files are 96mb....
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-06, 23:14:02
I've tried with a very simple file in a brand new scene, and it still fails to convert to tx
Title: Re: TX Files
Post by: haggi on 2015-08-07, 09:53:41
I'll check it. Could you give me your simple scene just in case you do something else than me?
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-13, 23:49:27
Here you go.

Just to be clear, the only thing i have to do is put those 2 lines of code into the script editor, python and run it, right?

Title: Re: TX Files
Post by: haggi on 2015-08-14, 09:41:12
Yes, exactly, that should work. I'll have a look.
Title: Re: TX Files
Post by: haggi on 2015-08-16, 13:32:00
Oh, yes, I simply oversaw that you path to the image files contains spaces what is often a source for problems. I fixed the script and in the next release it will work better. Meanwhile you can simply put the texture in a path which contains no spaces.
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-20, 00:14:45
no waaaay, bloody stupid spaces. I never spaces at work on Linux but Windows is full of them... I'll be careful with this. Thanks!
Title: Re: TX Files
Post by: hugojackson18 on 2015-08-25, 02:03:09
Right so I managed to create the tx files, replaced the file paths but it's still pretty slow. I don't understand why on the benchmark scene, I can render the whole thing in 2min but a simple scene with one object takes forever...
Title: Re: TX Files
Post by: haggi on 2015-08-25, 12:40:51
Which benchmark scene do you mean?
Title: Re: TX Files
Post by: hugojackson18 on 2015-09-03, 18:54:53
Alpha 1,0 benchmark. On my computer it's really fast, but in my simple scene, with 4 8k maps tx, it takes forever. i dont understand