martyj Posted January 27, 2016 Share Posted January 27, 2016 I have an tree model with an animation. When the animation ends I want to hide the child with the name of "top" My code, this->topOfTree = entity->FindChild("top"); this->topOfTree->Hide(); The Hide does not hide the entity. The model can be found here: http://martyj.net/oak_01.fbx Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 27, 2016 Share Posted January 27, 2016 The resulting auto-created MDL from that FBX does not have a child mesh named "Top". But when I open the FBX in UU3D and save as FBX, then the resulting auto-created MDL model has a child named "Top". But if you perform GetClassName() on the entity:FindChild() result, then you see it is listed as a 'Bone'. I can only get actual child meshes in the resulting MDL if I remove the bones/animations, save as FBX (with export groups as meshes option checked), and auto-create to MDL via the Editor. Doesn't appear that the current FBX to MDL converter allows for multiple children meshes with animation. It will allow multiple surfaces with animations though, so you may be able to just apply an invisible material to that surface you wish to hide? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
martyj Posted January 27, 2016 Author Share Posted January 27, 2016 How could one set a material for that specific surface? When I add a material to the top child, it doesn't do anything. Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 27, 2016 Share Posted January 27, 2016 Since you are using the same material for both meshes/surfaces, I had to import the FBX in UU3D with the 'Merge similar materials' option unchecked. I was able to essentially create two separate surface materials when I resaved as FBX. Attaching the resulting FBX: oak_02.fbx You could also just use two different materials/textures as well on the original model before exporting to FBX to get the same results. As for making the top part of the tree invisible, one of the ways it can be done is like this: tree = Model:Load("Models/tree/oak_02.mdl") topmat0 = tree:GetSurface(0):GetMaterial() topmat1 = tolua.cast(topmat0:Copy(), "Material") topmat1:SetBlendMode(Blend.Invisible) tree:GetSurface(0):SetMaterial(topmat1) I did the Copy since it was the same material being applied by default to both parts of the tree. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel 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.