Difference between revisions of "Interactable animated items"

From Divinity Engine Wiki
Jump to: navigation, search
(Blanked the page)
 
(16 intermediate revisions by one other user not shown)
Line 1: Line 1:
Interactable animated items are more complicated assets. These are usually used for doors, levers, buttons and any other object that needs to be interacted with. These usually exist out of 3D mesh, a physic mesh and animations.
 
<br />
 
<br />
 
<br />
 
<big>''' Setup '''</big>
 
<br />
 
<br />
 
<br />'''Bones'''
 
<br />
 
<br />
 
You can use either dummies, mesh or actual bones in 3DS Max to animate visuals. Make sure however that these bones are in a separate layer and are linked to a dummy which needs to be named Dummy_Root.<br />
 
If you are using a single bone for one mesh make sure to select that mesh and click the "MakeAnim" button.<br />
 
This can also be done by hand by selecting the mesh, right clicking on it, select '''Object Properties''', go to '''User Defined''' tab and type ''Rigid = true''.<br />
 
This also needs to be done with exporting a visual which consists of two meshes, one with multiple bones and one with a single bone. This only applies to the mesh with a single bone.
 
<br />
 
<br />
 
<br />
 
'''Skinning'''
 
<br />
 
<br />
 
Select the mesh you want to be animated, open the modifier list and select skin.
 
Add the bone(s) you want to use. Apply weight paint if needed.
 
<br />
 
<br />
 
<br />
 
'''Physics'''
 
<br />
 
<br />
 
Create your physics mesh and name it properly. Now you will need to link your physics mesh to your animated mesh.
 
  
We do this by using a proxy so the physics mesh can be animated. Start by right clicking on your animated mesh, select '''Object Properties''', go to User Defined" tab and insert the following lines:
 
 
<br />''Rigid = true''
 
<br />''LarianPhysics_Type = proxy''
 
<br />''Proxy_Geometry = “LayerName”_phys''
 
 
 
Now right click on your physics mesh, select "Object Properties", go to "User Defined" tab and insert the following lines:
 
 
<br />''LarianPhysics_Type = rigid_body''
 
<br />''LarianPhysics_RigidBody_Type = static''
 
<br />''LarianPhysics_RigidBody_Mass = 0.0''
 
<br />''LarianPhysics_RigidBody_Friction = 1.0''
 
<br />''LarianPhysics_RigidBody_Restitution = 0.0''
 
<br />''LarianPhysics_Shape_Type = convex''
 
<br />''LarianPhysics_Shape_Flags = 0''
 
<br />
 
<br />
 
<br />
 
<big>''' Exporting '''</big>
 
<br />
 
<br />
 
<br />'''Animation Manager'''
 
<br />
 
<br />
 
After you have created and tested your animation you’ll need add your animation to the animation manager.<br />
 
In the animation manager you can add multiple animations by first selecting the Dummy_Root at the top.<br />
 
Now you can create a new layer by clicking “new” in the bottom left corner. <br />
 
You will need to enter a name, the begin and end frame number of your animation. Each separate animation needs it own layer.
 
 
The name of you animation layer needs to be ''“LayerName”_”AnimationName”_”01”''
 
 
 
Example:
 
''
 
''DOORS_Humans_Ruins_A_Open_01''
 
<br />
 
<br />
 
<br />
 
'''Exporting'''
 
<br />
 
<br />
 
Exporting the visual is straight forward. Make sure your mesh and physics mesh are in the same layer. Any mesh without skinning will need to be linked to the Dummy_Root in the bones layer.<br />
 
You do '''not''' have to export anything other then the visuals and physics.
 
 
After exporting the visuals you will need to export the animation. Start of by saving the 3DS max file again in a separate folder located in the same folder.<br />
 
This folder needs to be named '''LayerName_AnimationName''', in here you will save your 3DS Max file as '''LayerName_AnimationName_01'''.<br />
 
If this is done correctly you will now be able to select the animation layers you want to export.
 
<br />
 
<br />
 
<br />
 
<big>''' Importing '''</big>
 
<br />
 
<br />
 
<br />
 
'''Importing your visuals'''
 
<br />
 
<br />
 
Importing your visual and physics is the same as any other item. Start by opening your '''content browser''', now select the proper package you want to add your visual to.<br />
 
Once selected add the resource by pressing the '''Add Resource''' button. Now you can choose to add your model or physics.<br />
 
Once you added your files you can now find it in your content browser either by selecting the proper package and finding it or using the search bar at the top.
 
<br />
 
<br />
 
<br />
 
'''Importing your animation'''
 
<br />
 
<br />
 
After adding your visual it is now time to import your animation. This process is similar to importing your visual.<br />
 
Start by opening your '''content browser''', now select the proper package you want to add your visual to.<br />
 
Once selected add the resource by pressing the '''Add Resource''' button. Now you can choose to add your animation.
 
<br />
 
<br />
 
<br />
 
'''Adding resources'''
 
<br />
 
<br />
 
After importing all you resources it is time to add all of them together. To start, open your '''Root template'''.<br />
 
Find your visual, double click it and a new window will open. You will start on the '''Materials''' tab to each of your meshes.<br />
 
Select the mesh you want to add the texture to, now ''find'' and ''select'' your texture in the '''content browser'''. Now you can add your texture by clicking the '''<-''' button.<br />
 
<br />
 
Now you can move on to the '''Default Animations''' tab, here you can add your animations. In the top right corner click on the drop down menu and select item. You should see a "list" appear with some animation slots.<br />
 
For doors we will use the open and close slots. Start by selecting the animation slot you want to add your animation to, ''dind'' and ''select'' your animation in the '''content browser'''. Now you can add your animation by clicking the '''<-''' button.<br />
 

Latest revision as of 12:39, 28 September 2017