map/texture enable/disable info

map/texture enable/disable info

Anonymous
Not applicable
776 Views
7 Replies
Message 1 of 8

map/texture enable/disable info

Anonymous
Not applicable

Hi,

 

In 3DS MAX, on the Compact Material Editor panel's "Maps" section, I unchecked the checkbox of one map channel item, i.e. "Opacity", (disable it), and then export it to FBX.

 

then I use FBX SDK to import the FBX, but I found the the texture is still available for "Opacity" map (FbxSurfaceMaterial::sTransparentColor):

 

 

FbxProperty prop = mat->FindProperty(FbxSurfaceMaterial::sTransparentColor);

int count = prop.IsValid() ? prop.GetSrcObjectCount<FbxTexture>() : 0;

for(int j = 0; j < count; ++j)
{
	FbxLayeredTexture* layer = FbxCast<FbxLayeredTexture>(prop.GetSrcObject<FbxLayeredTexture>(j));

	if( layer != NULL )
	{
		int texCount = layer->GetSrcObjectCount<FbxTexture>();
		for(int k = 0; k < texCount; ++k)
		{
			FbxTexture* tex = static_cast<FbxTexture*>( layer->GetSrcObject<FbxTexture>(k) );
			FbxFileTexture* fileTex = FbxCast<FbxFileTexture>(tex);
			if( fileTex != NULL )
			{
				const char* file = fileTex->GetFileName();
				...;
			}
		}
	}
	else
	{
		for(int k = 0; k < count; ++k)
		{
			FbxTexture* tex = static_cast<FbxTexture*>( prop.GetSrcObject<FbxTexture>(k) );
			FbxFileTexture* fileTex = FbxCast<FbxFileTexture>(tex);
			if( fileTex != NULL )
			{
				const char* file = fileTex->GetFileName();
				...;
			}
		}
	}

}//for each fbx layer

 

 

Code above is copied from the SDK samples.

 

It make sense that I can still get the texture file name of FbxSurfaceMaterial::sTransparentColor, but how can I check whether the texture is enabled/disabled like in 3DS MAX?

 

AFAIK in Max SDK I can use StdMat::MapEnabled() to check, but what about the FBX SDK?

 

p.s. I don't event know if this enabled/diabled info still available after exporting to FBX, so it's maybe inappropriate to post it here, but if the SDK doesn't support this, then the FBX exporter for 3DS Max can't handle that either, its still seems like a SDK feature.

 

0 Likes
777 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Can you disable a texture in MAX, then post the .fbx file?  You need to put fbx files in  a .zip file.

 

0 Likes
Message 3 of 8

Anonymous
Not applicable

Thanks for reply. What format do you need, ASCII or binary? or either will be OK?

 

BTW, I'm using max 2013 & FBX plugin 2013.1 Release (180734)

0 Likes
Message 4 of 8

Anonymous
Not applicable
ASCII please.
0 Likes
Message 5 of 8

Anonymous
Not applicable

Hi, zip attached, opacity maps of three material are disabled.

0 Likes
Message 6 of 8

Anonymous
Not applicable

 

Can you enable them and send me the exported file?  I want to see what changes.

 

0 Likes
Message 7 of 8

Anonymous
Not applicable

here's the fbx file when opacity map enabled. I compared the 2 files found nothing changes except materia/mesh IDs.

you may want to take a look too.

0 Likes
Message 8 of 8

Anonymous
Not applicable

I see the same thing.   Can you confirm that they have different enable states? 

0 Likes