Yes!
Oh! Alrighty! Will do!
Yes!
Oh! Alrighty! Will do!
Hey!
Is there a way to check if the current selected layer is a Skeleton layer?
The tool will add bone to the selected layer if it’s a skeleton layer. If it’s not a skeleton type, it’ll just add a new skeleton layer with bone accordingly.
I’m thinking to add active bone as a parameter to the skeleton layer. I think it’ll work well. As multiple layers will have their own active bone and just by selecting them, we can show the bone highlighted accordingly. What say?
Yes. The current selected layer(s) (yes, plural) are available via synfigapp::SelectionManager
. You can get this object via synfigapp::CanvasInterface::get_selection_manager()
.
You can check if a layer is of your desired type in two different way (at least):
Layer::get_name()
), oretl::handle<[YourLayerClass]>::cast_dynamic([YourLayerObjectHandle])
if it’s a handle) : check if it doesn’t return nullptr
and there you have it This is returning the user set name of the layer.
Will try this! Thanks!
No, it’s not The label user assign to a label is called layer description, actually Layer::get_description()
Nice Don’t forget to do such things via synfigapp
actions. Otherwise undo/redo won’t work.
I don’t think it’s the best way, as it is only useful for Synfig Studio, not rendering.
On the other hand, group layer already has such feature: lock children selection.
Anyway, you can do it if it helps you now at the beginning.
Ohhh!! Cool! I’ll check it out!
yep!
Oh! Will check it out!
Will try to not include it!
Rewording: group layer already has a parameter useless for rendering, just for editing in Studio.
Sorry my english XD
Weekly report : June 1st - June 7th
How was the last week? What did you accomplish?
ducks
, layer_Skeleton
, and Bone
classes.layer_Skeleton
.What is the #1 thing slowing you down?
What do you want to have done by the end of next week?
Not much work done as I had to work on some assignments deadlines. I will try to balance it with next week.
Yes, I agree about that.
I think there is no need to remember active bone in every layer.
I expect following workflow if user wants to modify existing Skeleton layer with Skeleton Tool:
If no skeleton layer is chose, then we’ll add a new layer and add a bone with origin at the click, right?
Alright. Will work in that direction.
Yes, exactly!
And after that the new Skeleton layer becomes selected. And added bone becomes active bone.
Cool!
I’ve tried to use the ValueDescCreateChildBone
to add child bone to the active bone. But it seems that the canvas is not set. How can I do that?
You can get canvas from layer.
How are we calling Non-static functions here? (sorry if it’s a silly doubt)
Here:
The code is an implamentation of a method of a class ( Action::ValueDescCreateChildBone
) that is derived from Action::CanvasSpecific
.
That highlighted line is not a static method call: it’s just saying to call the “parent” (Action::CanvasSpecific
) implementation of set_param()
using current (and compatible, as it’s a derived one) object (I mean the this
).
Ohh cool! Figured that immediately but forgot to delete it here. So silly of me
I made a new commit.
find_bone
to find bones near click.Actually, I want to change the color of the contour of the active bone. Can you suggest me the file I’ll have to refer to? Also, how do I enable handles when using this tool?
Please check this -
I am not sure what do you mean. Can you please clarify? ^__^"
Do you want to create new handles or reuse an existent one?
I can’t help you much, but “handle” is called “duck” in the code.
Sorry! I meant the ducks of the bones.
Okay! I already did! Maybe I missed something will do!