About Store Forum Documentation Contact
Donations:
225$/mo



Post Reply 
Material Variation Problem
Author Message
ronghester Offline
Bronze Supporter

Post: #1
Material Variation Problem
Hi There,

Is this code correct for setting different material variation..

chrcontainer[0].mesh()->parts[4].variation(2);

#some coditions
chrcontainer[0].mesh()->parts[4].variation(1) ;

I had this code working just couple of weeks back but it has stopped working now. May be something wrong. I have these variations working perfectly in the mesh editor and if I override default in object params the custom variation works only for the first session and in next session (if i restart the game) it again shows default variation. May be something it has to be with draw()??

Please help.

Thanks
11-30-2016 01:36 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Material Variation Problem
Those methods get/return variations, they don't set/change anything.
For drawing with a custom variation you need to call 'SetVariation' before calling mesh.draw
11-30-2016 10:55 PM
Find all posts by this user Quote this message in a reply
ronghester Offline
Bronze Supporter

Post: #3
RE: Material Variation Problem
Thanks. I followed this order and it worked!

setVariation(1);
draw();
setVariations();

I referred to the celshading sample to get it right.

Some update might have broken it, but trust me I had it working with variations or variation function before. Anyway that does not matter smile
12-01-2016 06:36 AM
Find all posts by this user Quote this message in a reply
Post Reply