Hi all!
I'm trying to make a drawing plugin using the addon SDK v1. I want to be able to modify the mesh of the instances of my object type at runtime. To do this, i created a mesh using wi.CreateMesh(2,2)
.
When this method is called, i receive the error "object does not support mesh". Digging a bit into the worldinfo.js code i find this:
CreateMesh(t, e) {
if (t = Math.floor(t),
e = Math.floor(e),
!this.GetInstance().GetPlugin().SupportsMesh())
throw new Error("object does not support mesh");
this.ReleaseMesh(),
this._meshInfo = {
sourceMesh: C3.New(C3.Gfx.Mesh, t, e),
transformedMesh: C3.New(C3.Gfx.Mesh, t, e),
meshPoly: null
}
}
So it seems that the plugin itself has a flag that tells Construct if its objects support mesh or not. However, i can't find anything in the docs related to this. Is it possible to allow a custom object type to use meshes?
Doing the same thing using a behavior on a sprite works since the sprite object by defaults allows the usage of meshes, so I wonder how i can achieve the same thing, but without a behavior and on a custom drawing plugin.