MasterK Posted December 13, 2016 Share Posted December 13, 2016 serialize will use the origin id. newMat = mat.clone(newName) can't work. need set newMat.id = newName. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 13, 2016 Share Posted December 13, 2016 Can you elaborate? What is the result of " newMat = mat.clone(newName) can't work. " Quote Link to comment Share on other sites More sharing options...
MasterK Posted December 14, 2016 Author Share Posted December 14, 2016 i mean when newMat = mat.clone(newName); the newMat.id should be newName, but it would be same as mat.id. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 14, 2016 Share Posted December 14, 2016 newName is for mat.name I can force the id to be a completely new one if you prefer? (like newMat.id = new GUID) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 14, 2016 Share Posted December 14, 2016 The id is often the name of the object I notice. When you give a new name to a clone, it renames the Name properly, not the id that has the old name of the object. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 14, 2016 Share Posted December 14, 2016 yep the idea is that you can use the id to keep a link with the original mesh Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 14, 2016 Share Posted December 14, 2016 It is true that this can be useful. In this case, you must: meshCloned.id = newName; Quote Link to comment Share on other sites More sharing options...
MasterK Posted December 15, 2016 Author Share Posted December 15, 2016 ok. i did it like you said. I just find it's not same as before... or maybe it's my wrong feeling. and when delete some material, the texture will be dispose, and other same id material's texture will also be disposed... I didn't deep look at it... but matClone.id = newName solved my problem. Dad72 and GameMonetize 2 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.