Jump to content
  • Advertisement
Sign in to follow this  
kgstation

Need Help!Export material data from 3ds max 2014 failed!

This topic is 2123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone!

I'm working on a mesh exporter!

I successfully export vertices and indices and face normal ets.

But I failed to export material!

        int materialCount = pIgame->GetRootMaterialCount();
	_cprintf("MaterialCount:%d\n", materialCount);
	Point3 p3;
	Point4 p4;
	PropType pt;
	IGameProperty* geoProperty;
	for (int matCount = 0; matCount < materialCount; matCount++)
	{
		IGameMaterial* geoMtl = pIgame->GetRootMaterial(matCount);
		geoProperty = geoMtl->GetAmbientData();
		if(geoProperty)
		{
			pt = geoProperty->GetType();
			if(pt == IGAME_POINT3_PROP)
				_cprintf("Ambient : %f %f %f\n", p3.x, p3.y, p3.z);
			if(pt == IGAME_POINT4_PROP)
				_cprintf("Ambient : %f %f %f %f\n", p4.x, p4.y, p4.z, p4.w);
		}
		geoProperty = geoMtl->GetDiffuseData();
		if(geoProperty)
		{
			pt = geoProperty->GetType();
			if(pt == IGAME_POINT3_PROP)
				_cprintf("Diffuse : %f %f %f\n", p3.x, p3.y, p3.z);
			if(pt == IGAME_POINT4_PROP)
				_cprintf("Ambient : %f %f %f %f\n", p4.x, p4.y, p4.z, p4.w);
		}
		geoProperty = geoMtl->GetSpecularData();
		if(geoProperty)
		{
			pt = geoProperty->GetType();
			if(pt == IGAME_POINT3_PROP)
				_cprintf("Specular : %f %f %f\n", p3.x, p3.y, p3.z);
			if(pt == IGAME_POINT4_PROP)
				_cprintf("Ambient : %f %f %f %f\n", p4.x, p4.y, p4.z, p4.w);
		}
		geoProperty = geoMtl->GetSpecularLevelData();
		if(geoProperty)
		{
			pt = geoProperty->GetType();
			if(pt == IGAME_POINT3_PROP)
				_cprintf("Specular Level : %f %f %f\n", p3.x, p3.y, p3.z);
			if(pt == IGAME_POINT4_PROP)
				_cprintf("Ambient : %f %f %f %f\n", p4.x, p4.y, p4.z, p4.w);
		}
	}

I simply create a box and six face with different material.

And I materialCount equals 1

But geoProperty always false!

I don't known what's wrong with my code.

Any help would be appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!