User Tools

Site Tools


democap:elementclasses

XML Element Classes

DEMoCap allows users and modders to create Behavior Elements using XML files (*.deeclass). These files can be placed in the project data directory in the directory models (recommended) or worlds. Element classes are detected automatically by DEMoCap and are then available to then add objects to the scene. See Examples for examples of *.deeclass files.

Before creating *.deeclass files it is recommended to open your project and to create an empty scene. Save the project with the empty scene active. This way if you make a mistake in the *.deeclass file you do not potentially damage your scene content.

Behaviors Explained: From A to Z

This list contains all the behaviors DEMoCap provides and that can be used in *.deeclass files to build own element classes. See Behaviors Explained: From A to Z or Behaviors Explained: By Use Cases for behaviors provided by the Drag[en]gine Game Engine.

A

C

D

G

H

R

S

T

W

Examples

Example *.deeclass file defining an element class sublassing an element class provided by DEMoCap. This is the most simple solution to add an element class which uses functionality provided by pre-made classes. You still can add more behaviors to them if required.

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='InflatableSeaDragon' class='DynamicProp'>
  <!-- Set element class property values. See the matching behavior documentation for
       all the supported properties. In this case the "ECBehaviorComponent" provides
       the "component.*" properties, "ECBSceneObject" provides the "sceneObject.*"
       properties and "ECBShowInteractHandles" provides the "showInteractHandles.*"
       properties. -->
  <string name='component.model'>inflatableSeaDragon.demodel</string>
  <string name='component.skin'>inflatableSeaDragon.deskin</string>
  <string name='component.rig'>inflatableSeaDragon.derig</string>
  <vector name='sceneObject.addActorOffset' x='0' y='0' z='0'/>
  <float name='showInteractHandles.handleSize'>0.25</float>
</elementClass>

Example of an *.deeclass file defining a full behavior element starting from scratch (using GenericBehaviorElement). This is more complex but allows to build an element class from scratch with exactly the behaviors you need. To be usable in DEMoCap at least the “ECBSceneObject” and “ECBSelectable” behavior has to be present with all the required dependencies.

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='TestISD' class='GenericBehaviorElement'>
  <!-- GenericBehaviorElement is by definition a blank behavior element class. You
       have to add all the behaviors to it you need. At least "ECBSceneObject" and
       "ECBSelectable" have to be present for DEMoCap to allow using the element class.
 
       While adding behaviors you can set element class properties directly
       from inside the behavior tag. In this case you have to remove the property
       prefix while keeping the "." at the beginning. DEMoCap prepends the behavior
       specific property prefix to form the correct property name. This form of
       setting property values is recommended since you do not have to remember
       the behavior property prefix. -->
 
  <!-- This element class produces the same result as the simple example before
       but by creating the element class from scratch. -->
 
  <behavior type='ECBBehaviorGuiPanels'/>
 
  <behavior type='ECBehaviorComponent'>
    <string name='.model'>inflatableSeaDragonRiding.demodel</string>
    <string name='.skin'>inflatableSeaDragon.deskin</string>
    <string name='.rig'>inflatableSeaDragon.derig</string>
  </behavior>
  <behavior type='ECBComponent'/>
 
  <behavior type='ECBehaviorCollider'>
    <!-- collision filter:
         category: BaseGameApp.CollisionFilterBit.geometry (0)
         filter: BaseGameApp.CollisionFilterBit.dynamic (1)
                 BaseGameApp.CollisionFilterBit.actor (2)
                 BaseGameApp.CollisionFilterBit.particle (5)
                 GameApp.CollisionFilterBit.interaction (7) -->
    <string name='collisionFilter'>0:1 2 5 7</string>
    <string name='.physicsType'>kinematic</string>
  </behavior>
 
  <behavior type='ECBehaviorAttachable'/>
  <behavior type='ECBehaviorAttachments'/>
 
  <behavior type='ECBehaviorNavigationBlocker'/>
 
  <behavior type='ECBehaviorVRHandPointedAt'/>
  <behavior type='ECBHighlightPointedAt'/>
 
  <behavior type='ECBSceneObject'>
    <vector name='.addActorOffset' x='0' y='0' z='0'/>
    <boolean name='.canRemove'>true</boolean>
  </behavior>
  <behavior type='ECBSelectable'/>
 
  <behavior type='ECBShowInteractHandles'>
    <list name='handleSets'>
      <string>move</string>
      <string>rotate</string>
    </list>
    <float name='.handleSize'>0.1</float>
  </behavior>
  <behavior type='ECBShowInteractionBubble'>
    <list name='.buttons'>
      <string>record</string>
      <string>ghost</string>
      <string>duplicate</string>
      <string>remove</string>
    </list>
  </behavior>
 
  <behavior type='ECBCapturedAnimations'/>
  <behavior type='ECBColliderPhysics'/>
  <behavior type='ECBRecordAnimation'/>
 
  <behavior type='ECBTemporaryGhost'/>
  <behavior type='ECBHideCondition'/>
 
  <behavior type='ECBCopyObject'/>
</elementClass>
You could leave a comment if you were logged in.
democap/elementclasses.txt · Last modified: 2025/03/22 18:38 by dragonlord