You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

Danglymeshes are surprisingly easy to set up and can be a very effective means of adding presence and life to your models.

What is danglymesh?

Danglymesh is a category of NWN mesh, just like Trimesh, Skinmesh and the others.

Use context

Danglymesh can be used on placeables, doors, creatures, tiles and probably other varieties of model.

The effect of setting an object as danglymesh

Danglymesh objects' geometry deforms in a physicalised way which is simulated based on a number of possible simulated forces that can act on the object; most notably, wind (as per your area settings), direct contact with creatures or other objects, movement of the object itself and/or its parent object, and other effects which exert a physicalised force (possibly explosive spells etc. - not confirmed by this author).

How to make danglymesh

Black Rider's step-by-step PDF tutorial on how to make danglymesh is probably the best starting-point: https://neverwintervault.org/article/tutorial/danglymesh-aurora-flex-blender-279-28-tutorial-nwn1-models

There have been some UI changes to Blender since that tutorial was written but all the names of options, menus and settings appear to have remained the same as of Blender 3.0 (at date 23/02/2022).

However, that tutorial does not explicitly state how vertex weights work, presumably because the author believed it was obvious. There is a more detailed explanation and mini-tutorial on how vertex weights and weight painting works, below (see 'Vertex Weights').

In brief, the process for creating danglymesh is:

  1. change your mesh type from (trimesh/skinmesh/animmesh/whatever it may be) to Danglymesh (in Blender this is done via a dropdown menu in the Object Properties - Aurora Mesh Properties - Trimesh Properties rollout)
  2. select all the verteces of your object (you will need to use Edit Mode if using Blender), and assign them to a vertex group (this is done in the Object Data Properties rollout in blender)
  3. set the weight of your vertex group to 0.0, in order to set yourself up properly to start painting verteces - in Blender make sure to click 'assign' so that the weight is applied to your vertex group
  4. paint your vertex weights; in Blender this is done in the Weight Paint mode
  5. after having painted your vertex weights, make sure you have set the object-wide danglymesh properties (Period/Tightness/Displacement) as you wish them to be set (in Blender this is done in the Object Properties - Aurora Mesh Properties - Danglymesh Properties rollout)
  6. that's it!

Object-wide danglymesh properties

There are properties set at the object level for a danglymesh, namely (in NeverBlender terminology) 'Period', 'Tightness', and 'Displacement'.

The effects of these properties are described in the tutorial linked above.

Note that these properties do have a very great effect on how your danglymesh behaves. You will want to experiment by adjusting them to see their precise effects on your mesh. With a little tweaking of these properties, and of your vertex weights (see further below), you can create some incredibly naturalistic animations (considering how ancient and basic this system is).

Vertex weights

You can paint vertex weights in Blender using the 'Weight Paint' mode, as described in Black Rider's tutorial linked above.

The way vertex weights work in practice for danglymesh might seem obvious, but is worth stating anyway:

The rule is essentially that the lighter the weight of a vertex, the more that the portion of the model surrounding that will be affected by all the forces described above - subject of course to the effect of the object-wide properties described above. 

A vertex with a weight of 1.0 will not be moved at all by any danglymesh-affecting forces. Use a weight of 1.0 if you want a vertex to be a 'fixed point'.

A vertex with a weight of 0.0 will move the maximum extent possible within the constraints of the object-wide properties set for the danglymesh object.

In Blender, when painting vertex weights in 'Weight Paint' mode, blue colouring indicates lighter vertex weight (down to a minimum weight of 0.0).  The colours shade through green to yellow and on to red as weights increase. Red colour means high or highest vertex weight (up to weight of 1.0).

Example - vertex weight painting

The above image shows a placeable's mesh whilst in Weight Paint mode in Blender. This mesh was for a set of hanging vines. The top of the mesh therefore needed to stay fixed, whilst the trailing bottoms of the vines should be free to blow in the wind or animate appropriately if the vines are moved or touched by another object.

You can see that the top of the mesh is shaded to red; the verteces have been assigned heavier weights. This means that the top will stay fixed in position (in actual fact it is not quite full red, as you can see, which indicates that the verteces aren't set all the way up to 1.0 weight, therefore they will move a little bit, which was acceptable in this context). 

By contrast the middle and bottom of the mesh have a gradient rapidly shifting in the spectrum away from red/yellow through green and towards a deep blue. This shows that much of the mesh has a light weight, almost reaching a weight of 0.0 at the very bottom of the mesh where I wanted the light ends of the dangling vines to be able to move around a lot.

Here is how the above looks in-game when the placeable (and another, slightly different one behind it) is moved using SetObjectVisualTransform:

https://gfycat.com/whirlwindquarrelsomecollardlizard


How to quickly paint your vertex weights

I achieved the above using Blender's handy gradient tool in Weight Paint mode:

Set the Weight you wish to start at (where your mouse position is), the strength with which you want the gradient to overwrite any current vertex weights, and the manner of gradient (linear/radial and the falloff curve) then simply click and drag across your mesh, and you'll see a nice gradient of weights being applied. This is an extremely quick way to apply a good and smooth range of weights, I have found.

Applying a uniform weight to all verteces (painting the primer!)

You may also at times find it helpful to apply a certain weight to all your verteces, perhaps to set a baseline minimum weight for them all before then applying the gradient you want. You can do this by selecting all your verteces with the 'Select' menu (see the buttons at the top of the above screenshot) (click 'Select' → 'All'), and then using the 'Weights' menu (next to 'Select') option called 'Set Weight' to apply the current Weight you have (see top-left of the above screenshot where you can see the Weight slider) to all your verteces.

Note on how verteces of different weights vs. verteces of identical weights interact with one another

If you set all the verteces in your mesh to weight 0.0, you will notice in-game that the entire mesh will probably wobble about rigidly, as if it were completely solid but dangling on some kind of bizarre invisible spring. This is a demonstration of what happens if you have multiple verteces adjacent to each other which have the same weight; whilst (as long as your settings allow) they will move when a force is exerted on the mesh, they will move identically and uniformly, i.e. they will appear to be rigidly attached to one another.

This is why the gradient tool, the use of which I have described above, is such a good way to paint your vertex weights - if, that is, your danglymesh is for an organic or fully flexible type of object such as hair, loose leaf foliage, loose rope, or flowing cloth. However, if you wanted to have, for example, a chain that was mostly in-flexible and only flexes in specific places, you could do that by having uniform weights for all the verteces in each rigid section.

Problems with danglymesh

Note that if you set an object as danglymesh but do not set a vertex group under the 'Constraints' field in Blender (in the NeverBlender 'Danglymesh Properties' part of the Object Properties rollout) then you are liable to experience NWN client crashes when you try to load into an area with your danglymesh object. Follow Black Rider's tutorial to quickly set up your vertex group, then sort out your vertex weights and object-wide attibutes. You should no longer experience any crashes if your danglymesh is set up properly.


  • No labels