PDA

View Full Version : Some coffee help, remove texture from material


TimCallaway
08-28-2012, 05:24 PM
Hi, I'm new to Coffee, so bare with me..

We are using c4d as part of our pipeline, and as most know there is the issue with no render layers. I am creating this script to help the lookdev folks speed up the process of creating all the different scenes.

I got everything working well, just one little thing.

I want to clear the texture from a shader, what would I do to do that?

mat#MATERIAL_COLOR_SHADER = ? ;

This seems to be the right one, just how to clear it?

I have the script go through the materials and set some attr's, change the color to white, just need to clear the texture.


var mat = doc->GetFirstMaterial();
if(!mat)return;
while(mat)
{
if(mat->GetName() == "Skin")
{
mat->SetBit(BIT_ACTIVE);
mat#MATERIAL_COLOR_COLOR = vector(1,1,1);
mat#MATERIAL_COLOR_SHADER = ?; //What do I use to clear this?
}
mat = mat->GetNext();
}

TimCallaway
08-28-2012, 06:25 PM
Ok, I got it to work, dunno if it's the correct way, but it was a typo and workd lol.

I just left the var i was using, and it clears the texture.

var mat = doc->GetFirstMaterial(); //Get The first Material
if(!mat)return; //Error handling if no materials exist
while(mat)
{
if(mat->GetName() == "TearDucts") // Look for the name "TearDucts"
{
mat->SetBit(BIT_ACTIVE); // Set it as active
mat#MATERIAL_COLOR_COLOR = vector(1,1,1);// set color to white
mat#MATERIAL_COLOR_SHADER = mat;
}
mat = mat->GetNext(); // Get the next material if name is not found
}

CGTalk Moderation
08-28-2012, 06:25 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.