I’m very new to Armory, and I’m looking to do something that I haven’t found a lot of info on. What I want to do is to be able to manipulate the geometry of a mesh (really for me right now I want to manually control the coordinates of points that make up a path). I know how to do this in python, for example:
I am having a hard time understanding if something like this is possible from within a haxe trait (to my knowledge I cannot use python scripts at runtime). I want to do this because the coordinates will be generated from algebraic equations that will change based on user input. I am open to alternatives (geometry nodes that can be initiated from a trait?)
To clarify, the closest example I have found is here (generate_mesh · armory3d/armory Wiki · GitHub), but maybe because of my inexperience and difficulties tracking down documentation I’ve had a hard time getting any value out of this example for my situation.
Curves or paths are not exported to armory you can’t use them, you can use empty and mesh objects. If your mesh does not have triangles it will not contain any info of faces so it will not be visible in armory.
No you can not use python at runtime but you can use nodes and haxe traits. The example you are talking about is to generate 3d mesh. If you want to change the vertex positions at runtime you would need a lot of modifications to do in the geometry of the mesh (complex). If you need the mesh object to change maybe you can use shape keys.
There is a get geometry node you can use to retrieve object vertex positions and vertex groups. If you want you can use a curve mesh and retrieve the positions using vertex groups (the red ball circles are just that)
If you want you can draw curves on armory based on the positions but they will be 2d or you can make 3d curve spawning objects. And for that you don’t need the mesh info… just the positions of your function.
I do not fully understand what are you really trying to do maybe a different approach can be done. You need to explain with a little more context.
For more context, I currently have a “beam” with a curve modifier. I am deforming the beam by changing the positions of the nodes in the path, which I figured would be the easiest way to do it in vanilla blender because I only have to change the position of one node as opposed to 4 vertices on the beam.
So it sounds like I need a different approach, and now that I think about it I’m not sure if I can even use the curve modifier to dynamically update the shape at runtime.
I would prefer not to use shape keys, because I would like an “infinite” number of possibilities for the shape of the beam, again the shape is described from an algebraic function that can change. It sounds like my only solution is to manually change the location of all of the vertices in the solid, which is complex for a couple of reasons. It also sounds like I need to remesh to triangles for it to work properly in Armory.
Let me know if I’m missing anything or if you need more info.
But your shape is regular so it can be divided in small cubes… since you have the position of each cube you can then spawn them according. The gaps you will have will depend on how much points you will use and the size of each cube.