I must stupid but I have been following the instructions at http://help.adobe.com/en_US/Director/11.5/Beginners/WS16484b78be4e1542207b595813093835e2c- 8000.html on how to create a cloth.
The instructions on that page are:
member ("physics").createclothresource(modelref, [flipNormals])
member ("physics").createcloth(clothname ,clothres, clothmodel, density,thickness)
So I have set up a 3d world member with a single mesh model and inserted a physics object I called "physics".
Next I've set up a behaviour for the 3D member following the instructions from that link above.
sp = sprite(me.spritenum)
mem = sp.member
modelRef = mem.model("plane") -- this a single mesh model
gDensity = 2.0
gThickness = 1.8
a = member("physics").createclothresource(modelref)
member ("physics").createcloth("banner",a, modelRef, gDensity,gThickness)"
However Director alerts an error everytime it encounters the line "a = createclothresource(modelRef) " saying "Error - Script Error -21".
Can anyone tell me where I am going wrong?
You need to add the meshDeform modifier to your model to allow Ageia access to the geometry:
Yep I scoured the online cloth related references via the online docs and came across a demo director filecalled "clothanim.dir" which showed the addModifier(#meshDeform) line you mentioned. So thanks for confirming that. It all works good!