General Category > ASL Scripts
Old Magnet Tool
odp04y:
I can't get it to work (i got a triangle faced mesh as MAGNET with M_PUSH material, neither are rotated, magnet script works but not this one) ???
Francesco:
Uhm, sorry but I have no real idea... I think I have to let the script output some debug information.
As for now I suggest you to check whether the magnet's origin is where you think it is.
Doubleclick the magnet and enter (0,0,0) as its location. If then it lies centered around world's (object's) origin, then the magnet's origin should be right.
If setting magnet's location to zero you happen to find it displaced away from object's origin, then enter point edit mode, select all points and bring them around the object's origin. Once you have done this, you can freely move the magnet.
I came to realise that there is no way to access pivot's position from within ASL, I cannot make this script easier to use until ASL allows me accessing pivot's position.
I am about to modify the script so that it creates a copy of the magnet and triangulates it, so that you will be able to use any kind of mesh as magnet.
I still need help with rotation matrix, I hope that someone could give me a quick insight on that and on its use.
[edit: here is a project whose magnet and mesh01 should work - I've just tested them. I attach a picture of another example, applied the magnet 4 times with M_PUSH_Z, wireframe, raw render, subdivided render. ]
NickE:
You can access and change the object's pivot position in ASL. It is referred to as "orientation" as a quaternion type. You can construct a new quaternion of the rotation you desire and apply it to the whole object or you can can use the "toFloat4x4" and "Project" methods to change the orientation of the object on a point-by-point basis. See the chain maker script or the copy source mesh to target mesh scripts for examples of how the orientation can be manipulated.
Francesco:
Silly me, I was looking for a point3 just like the location... Sorry, my fault. Thank you NickE, also for the pointers.
Francesco:
Uhm... I fear that the pivot's position is not truly accessible from ASL... pivot's position and orientation are stored separately in projects files, that should be the same in ASL.
Please tell me if I'm banging my head or if I can extract pivot's position from orientation, I really need this.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version