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

Sub forum for help and tutorials.

Moderator: JimStar

Post Reply
rudigude
Licensed Customer
Posts: 11
Joined: Thu Jul 15, 2010 6:56 am

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
calus
Licensed Customer
Posts: 1308
Joined: Sat May 22, 2010 9:31 am
Location: Paris

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.
Pascal ANDRE
Post Reply

Return to “Help / Tutorials”