Ruki Posted September 2, 2015 Share Posted September 2, 2015 I *might* not be using this correctly, but if you call GetMaterial() on an entity/model loaded in C++ which has a material assigned to it in the LWEditor, it returns NULL, even though you can see ingame that the model has a material being rendered on it. If you call SetMaterial() and load a material into it, GetMaterial() will return the correct Material. Just to clarify, this only fails if you set the material in the LWeditor. Is this the intended use? Windows 7, Visual studio community 2013 Quote Link to comment Share on other sites More sharing options...
Josh Posted September 2, 2015 Share Posted September 2, 2015 What kind of object is this, a brush or model? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Ruki Posted September 2, 2015 Author Share Posted September 2, 2015 What kind of object is this, a brush or model? A "Model". I did a test snippet and I'm 90% sure it's bugged, unless I'm doing something wrong. I tested it using the default Barrel Model, which definitely does have a material in the LW editor. Model *testModel = Model::Load( "Models/Barrel/barrel.mdl" ); if ( testModel->GetMaterial() ) myMain->flag( "Barrel has material!" ); else myMain->flag( "Barrel has NO material.." ); Output says that the barrel has no material, but it shows up ingame as having the blue/yellow material on it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.