Transform Bones Script
Posted: Mon Jun 01, 2009 6:04 am
I was complaining about AS 6 not having the ability to resize bones during a copy/paste (one of the things Vern's script did) and I suddenly realized this wouldn't be a big deal to program so here's a 5.6 version of that:
http://www.kelleytown.com/freeware/mk_i ... sforms.zip
I haven't tested this yet in 6.0 but I will shortly. However, along with most folks 5.6 will be my production tool for a while to come so I wanted to get this up in case anyone else needed it. It works by taking the layer transforms and applying them to the bones and then resetting the layer. A couple of notes for those brave or foolish enough to try it:
1) It works on any frame other than zero. This was by design but right now it doesn't matter much since the transforms of the bones are the same no matter what frame you do them on. Later it may be a bigger deal (see below).
2) Position and scale work more accurately if you do them one at a time. You can do them together but due to the way the cumulative effects are the position will be a little off (scale will be correct, though). I will work on fixing this but position is mostly for eyeing how the scale should be (IOW, the idea is you copy your bones in and then align and scale as needed).
3) Rotation works but since the axis of the layer is central and rotation is more complicated (needs to be the parent) your position will move more or less depending on how far you are away from the layer center. Once again, mostly for eyeballing purposes of getting the bone scale right, but I'll work on trying to get it better.
4) Eventually the idea is to apply this not only to bones but to vector layers and then to groups (with all children in that group inheriting the transforms). I suspect it will be far easier to apply this to vectors but given how very little I know about the AS API and how little it's documented it's kind of slow going (with better documentation I would have had this done in a heartbeat, as the programming is REAL straightforward. Right now the only way to actually program ANYTHING in AS is trial and error and standing on the shoulders of those who came before. In that regard I thank Vern for his bone copying script or I wouldn't even have a clue as to where to begin).
If I can get this working the way I want then it will create keys for animation purposes (right now there isn't any need or functionality to having keys for the bones, since you can't undo or use them in any way -- bones are sized and positioned the way they are at frame 0).
(The best part about releasing this now is that it's sure to get lost amid all the 6 talk so that only the hardcore folks will criticize :>)
http://www.kelleytown.com/freeware/mk_i ... sforms.zip
I haven't tested this yet in 6.0 but I will shortly. However, along with most folks 5.6 will be my production tool for a while to come so I wanted to get this up in case anyone else needed it. It works by taking the layer transforms and applying them to the bones and then resetting the layer. A couple of notes for those brave or foolish enough to try it:
1) It works on any frame other than zero. This was by design but right now it doesn't matter much since the transforms of the bones are the same no matter what frame you do them on. Later it may be a bigger deal (see below).
2) Position and scale work more accurately if you do them one at a time. You can do them together but due to the way the cumulative effects are the position will be a little off (scale will be correct, though). I will work on fixing this but position is mostly for eyeing how the scale should be (IOW, the idea is you copy your bones in and then align and scale as needed).
3) Rotation works but since the axis of the layer is central and rotation is more complicated (needs to be the parent) your position will move more or less depending on how far you are away from the layer center. Once again, mostly for eyeballing purposes of getting the bone scale right, but I'll work on trying to get it better.
4) Eventually the idea is to apply this not only to bones but to vector layers and then to groups (with all children in that group inheriting the transforms). I suspect it will be far easier to apply this to vectors but given how very little I know about the AS API and how little it's documented it's kind of slow going (with better documentation I would have had this done in a heartbeat, as the programming is REAL straightforward. Right now the only way to actually program ANYTHING in AS is trial and error and standing on the shoulders of those who came before. In that regard I thank Vern for his bone copying script or I wouldn't even have a clue as to where to begin).
If I can get this working the way I want then it will create keys for animation purposes (right now there isn't any need or functionality to having keys for the bones, since you can't undo or use them in any way -- bones are sized and positioned the way they are at frame 0).
(The best part about releasing this now is that it's sure to get lost amid all the 6 talk so that only the hardcore folks will criticize :>)