Can't get material

Forum for reporting problems
Post Reply
Rudy F
Posts: 0
Joined: Thu Feb 04, 2021 12:18 am

Can't get material

Post by Rudy F »

Hello
I am getting null when I cast IAppearance_DG to IMaterial using this code:

Code: Select all

	    IEntity_DG entity = iStdShape.Box(1, 1, 1);			//iStdShape is IStdShape
            IAppearance_DG apppearance = iEntity.GetAppearance();
            apppearance.SetColor(1.0f, 0, 0);    
            // Get material to modify specular color 
            IMaterial material = iAppBox as IMaterial;
Is there any problem with it?
Thank you

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Can't get material

Post by Prashant Kande »

Hi Rudy

Get it from the entity: IMaterial material = entity as IMaterial;

It is a good point though. We will add handling the query in v6.2.

Thank you for reporting

Post Reply