Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 kgs   Members   -  Reputation: 205

Like
0Likes
Like

Posted 28 September 2013 - 09:11 AM

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!


My english is very poor!

Sponsor:

#2 kgs   Members   -  Reputation: 205

Like
0Likes
Like

Posted 29 September 2013 - 08:45 AM

Problem solved


My english is very poor!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS