Jump to content

Mantra auto check and replace if RAT texture exists


Recommended Posts

Hello,
Mantra during rendering is always converting all non-rat textures into rat and then discarding them after the render is finished. So I am considering batch-converting all of them to rat using the iconvert tool while keeping their original name and replacing only file extension. Batch conversion of textures is not a problem, but I am curious about re-linking them in shader networks.

Arnold has an elegant solution for that - it checks if there is a .tx version of a texture and if so, it will use it and save some time. It also allows to do one-time conversion during the first use of a texture and then it will keep .tx version around inside the texture folder.
So I am humbly hoping that there is somewhere hidden feature for this behavior also in Mantra. Any experience with that?

Otherwise I can just scan all shading nodes in Houdini with python and replace texture file extensions for rat.

 

Thanks,
Juraj

  • Like 1
Link to comment
Share on other sites

Mantra, right now, has no feature like that one in Arnold... shame. as for replacing all the textures, the best is to make a setup that allows for easy replacement anytime, of course :) 

anyway, try 'opchange' in texport. it works like a search > replace for any strings in the scene so I suppose if you type something like...

opchange -T SHOP exr rat

...you should get "rat" wherever was "exr" before. -T SHOP tells it to look at the shop networks only,

check the docs for more info.

 

cheers.

  • Like 1
Link to comment
Share on other sites

Hi, thanks for great tips :)
I will think about the converter, but to make it easy to use for artists I guess it will be a shelf tool where you will select a folder and the tool with scan all textures and convert them.

I will check this opchange hscript command, seems to be good and easy choice for this task :)

Link to comment
Share on other sites

13 minutes ago, marty said:

It's worth running tests to see if the conversion to Rat is slowing anything down. Last time I checked EXR was just as fast.

yes. not using rats slows down everything and it eats much more memory. with a few textures you may not even notice the difference but at some point your renders will become very slow and very memory hungry. I'm talking about differences like 4h/90gb ram/frame with exrs vs. 1h/40gb ram/frame with rats. These are made up numbers but I've seen this on some texture heavy projects.

Edited by davpe
Link to comment
Share on other sites

yes. it converts the files and holds it in the memory while rendering. so not only converting alone for every frame can take quite a long time but also it can easily fill up your ram and then actual rendering runs on swap.

Link to comment
Share on other sites

that sounds like a bug then, it should convert to a rat, write that as a temp file then use that to continue rendering. There is no reason to hold the original in ram.

Link to comment
Share on other sites

this env variable is pretty useful then:

MANTRA_NONRAT_ERROR

Quote

 

    Normally, mantra will automatically convert texture files that are not

    in .rat format to .rat format internally - which can slow down render

    startup.  To disable automatic conversion to .rat format and instead

    print out an error when textures are not in the native format, set this

    variable.

 

 

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...