Jump to content

Hide parent but not its children


AggrorJorn
 Share

Recommended Posts

I have a mesh placeholder that I drag in my scene. The placeholder loads several other models that are parented to the main model.

 

When I try to hide the main model it also hides it's children.

 

function class:CreateObject(model)
local object=self.super:CreateObject(model)

self.modelA = LoadModel("abstract::modelA.gmf")
self.modelA:SetParent(object.model)	
object.model:Hide()
--self.modelA:Show()

Does anybody know how to show a child while the parent remains hidden.

Link to comment
Share on other sites

I don't think you can get around it. We ran into a similar need and got around it by having two meshes. Swapping them in/out was quite fast (same model with bits chopped out using same materials). Not quite the same thing as yours though.

 

Perhaps you could paint the parent entity with the "invisible" material when you want to hide it, and paint it with it's normal material when you want to display it again.

 

PaintEntity(entity,"abstract::invisible.mat",0)

 

Where 0 means "non recursive".

 

??

 

Just a thought.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...