I should note that I just added a PaperBoneAttachment3D node in the latest 1.2 update, if that suits your needs better.
That's great to hear, albeit with slightly humorous timing, considering that I just released version 1.3 haha.
There's actually a bit of a significant oversight with my implementation of material caching in 1.2 (realized that it cause would multiple instances of the same PaperSkeleton scene to share the same material, making things like independent texture changes between them impossible), of which I completely rolled back in 1.3, so I recommend upgrading to that whenever you can.
I´ve updated to 1.3a now and I have a couple of bugs/issues that were not present in 1.2. They may be related to my implementation but they showed up in 1.3 and reverting to 1.2 fixes them. With the exception of adding to the complex shader I have not tweaked any of the addon files.
1 - When flipping the model, by setting the flip_model var to true, the bone attachments get rotated along the x axis 90 degrees making the objects point towards the camera. It looks good again flipped back. Apparent in the editor. It also breaks the billboarding of the bone attachement, moving the camera around the bone attachment stays in the same 3d position rather than following the model around as the camera moves.
2 - Polygons that are supposed to be hidden are visible during play, I cannot replicate this in the editor. I am 'dressing' up my models like literal paperdolls with several layers of pylogons and I set unused pylogons to not be visible.
It works as intended when they are intended to be visible, but turning visibility off seems to not be respected, or rather, the initial state of visibility seems to not be respected. Whether set by code running in ready setting them to the correct values or turning off the visibility through the inspector beforehand. The issue only seems to happen upon loading and initializing the paperskeleton. Later when changes happen during play, updating the visibility still seems to work.
Thanks in advance for any help or insight you may provide.
Thank you very much for your feedback. I've implemented fixes that I believe should solve those two issues.
First off, the bone attachments. This was due to a new implementation I added to improve parity. You see, the `flip_model` property just inverts the scale on the x-axis. This is fine, but seeing as how everything else flips by, well, flipping, I've decided to introduce new code to make it so that bone attachments would rotate instead of having their x-scale inverted. Unfortunately, my implementation introduced a few issues:
- Failing to consider that some might actually want their models to be flipped for varying reasons.
- I based the transform calculations off the base PaperSkeleton's transform and not its `billboard` node.
- My math also had some other mistakes, with the rotation actually being significantly off.
These all should be fixed in the new update. There's an `invert_x_scale_when_flipped` property implemented, as well as fixes for the other two issues.
Secondly, the visibility bug. Very simple fix really. You see, I initially had the PaperSkeleton node constantly check if the Polygon2Ds' visibility were toggled. Instead, now I have it change during the `NOTIFICATION_VISIBILITY_CHANGED` notification on each PaperPolygon2D. Unfortunately, I neglected to initially define this visibility upon instantiation, of which it now does, so consider the bug fixed. Also, I tweaked it so that it references `is_visible_in_tree()` instead of `visible`, so that its visibility can be toggled as a group when put underneath a child of a node that's not visible.
If there's still something wrong with any of these feature, please let me know.