Jump to content
UK_Apollo

Hiding animated parts

Recommended Posts

How do you provide the ability to hide a part of an object that is also animated (when not hidden)?
 
Example
A door has a camo net attached.
When the door is opened, the camo net moves with it.
The camo net also needs to be hideable.
 
The Problem
The camo net moves with the door when it opens, no problem.
However, it does not hide when the animationSource for hiding the camo net is fired.
 
If you decouple the camo net from the door (by removing the skeletonBones link), the camo net hides, but of course no longer moves with the door.
 
So to reiterate the problem, how do you both animate (move) and display/hide a part?
 
 
Here is a simplified portion of the code currently in use.
What needs to be added to get the camo net to hide when the animation source "CamoNet_Hide" is set to 1?
 
 
p3d named selections
door (LOD 1+)
camoNet (LOD 1+)
door_axis (memory points)
 
model.cfg

class CfgSkeletons {  
   skeletonBones[] = {   
      "door", ""
      "camoNet", "door"
   };
};

class CfgModels {
   class Animations {
      // Door
      class Door {
         source = "Door";
         sourceAddress = "clamp";
         type = "rotation";
         selection = "door";
         axis = "door_axis";
         memory = 1;
         angle0 = "rad 0";
         angle1 = "rad 75";
         minValue = 0;
         maxValue = 1;
      };
      // Camo Net
      class CamoNet_Hide {
          source = "CamoNet_Hide";
          type = "hide";
          selection = "camoNet";
          hideValue = 1.0;
      };	
};

config.cpp

class AnimationSources {
   class CamoNet_Hide {
      displayName = "Hide Camo Net";
      source = "user";
      animPeriod = 1;
      initPhase = 0;				
   };			
   class Door {
      source = "door";
      animPeriod = 1;
      initPhase = 0;
   };
};

Share this post


Link to post
Share on other sites

Interesting. I would try using the door as the source animation for the camonet.

If you wanna pm me a link to the object I can take a look. That may be easier.

But I guess in theory it should still function like the glass pane in to door that can be shot out. That glass pane moves with the door. And can be hidden once destroyed.

Share this post


Link to post
Share on other sites

There seems to be a difference between hiding on destruction (source="damage") which works fine and hiding on a user animationSource.

 

The following code works alongside the animation of the camo net on the door, but change the source to a user defined class from config.cpp and it no longer plays ball.

class Animations {
   class CamoNet_Destruct_Hide {
      source = "damage";
      type = "hide";
      selection = "camoNet";
      hideValue = 1.0;
   };
};	

Share this post


Link to post
Share on other sites

It's not a problem with a specific model.cfg that I want resolving, it's an answer to the question of "is it possible?".

And if yes, how do you do it?

Share this post


Link to post
Share on other sites

yes, it's possible

well, everything you posted seems to be valid so I cannot provide generic solution to your issue

  • Like 1

Share this post


Link to post
Share on other sites

Uk. If you ask for help you gotta be prepared to show the whole config not just a portion. It could be something further down in the file that is messing up the first part. That's why reyhard is asking.

Share this post


Link to post
Share on other sites

This is really a question to a generic problem. It's not specifically related to a single project or specific config so there is no additional code for anyone to find a mistake in. The example I gave is just a simplified framework for discussion.

As I mentioned, I'm interested in whether anyone had come across this before and how they had solved it, in a generic way.

 

Thanks for the thoughts so far.

Share this post


Link to post
Share on other sites

I don't know. It seems to me that you have a particular model and config. So why not provide them and let a senior person try and help. When you mask the issue with only providing parts of a config it doesn't help solve the problem. That's all I'm saying.

Share this post


Link to post
Share on other sites

Solution, confirmed working:

 

model.cfg

class CfgSkeletons {  
   skeletonBones[] = {   
      "door", ""
      "camoNet", ""
   };
};

class CfgModels {
   class Animations {
      // Door
      class Door {
         source = "Door";
         sourceAddress = "clamp";
         type = "rotation";
         selection = "door";
         axis = "door_axis";
         memory = 1;
         angle0 = "rad 0";
         angle1 = "rad 75";
         minValue = 0;
         maxValue = 1;
      };
      // Camo Net
      class CamoNet_Move : Door {
          selection = "camoNet";
      };
      class CamoNet_Hide {
          source = "CamoNet_Hide";
          type = "hide";
          selection = "camoNet";
          hideValue = 1.0;
      };	
};

config.cpp

class AnimationSources {
   class CamoNet_Hide {
      displayName = "Hide Camo Net";
      source = "user";
      animPeriod = 1;
      initPhase = 0;				
   };			
   class Door {
      source = "door";
      animPeriod = 1;
      initPhase = 0;
   };
};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×