Page 1 of 1

Fast way to switch Image Texture (RGB) to Float ?

Posted: Thu Nov 10, 2016 10:27 am
by rudigude
I created a lot of shaders networks with octane image texture for specular and height (Noob). Obviously I ended up using a lot of extra memory because of this. Now I want to replace the image Texture(RGB) nodes to float Image texture.

There is a fast way to do this like in the standalone?

Thank you

Re: Fast way to switch Image Texture (RGB) to Float ?

Posted: Thu Dec 01, 2016 1:04 pm
by calus
You could use the nodeCast mel or python comand,
this command replace a node by another wile keeping connexion and attributes value where it's possible.

Code: Select all

import maya.cmds as cmd

RGBs = cmd.ls(sl=True, typ="octaneImageTexture")
for RGB in RGBs:
	GREY = cmd.createNode("octaneFloatImageTexture")
	cmd.nodeCast(RGB, GREY, f=True)
	cmd.delete(RGB)
just drop this script in a shelf as a python button,
use it to replace every selected RGB image texture node by a float image node.