Without separating the layers into separate grease pencil objects…
I have a character with shapes separated by ‘depth’ on different layers. I.e. Layers 'right arm, torso, head, left arm…etc. The right arm layer is on top indicating that it is in the front of the other body shapes.
I have another grease pencil object of a sword and I want the sword to pass behind/under the right arm layer and in front the torso layer. This can done by adding a “mask” layer with a duplicate of the right arm shape with a ‘holdout’ fill material or by using layer masking.
But if the right arm shape moves, the mask on the sword gpencil needs to be manually moved/redrawn too.
Is there a way/modifier in the Sword GPencil to use RightArm layer as a mask layer?
My opinion is that a prop a character uses or interacts with should be a layer within the same object for many reasons (masking ie). If you insist to have it as separate GP you must use 3d stroke Depth order instead of 2d and move slightly every part on Y axis to avoid overlapping like in my example (know that if you have to redraw strokes and interpolate it will be confusing) : 3d_stroke_depth_order.blend (998.8 KB)
I strongly suggest to keep the sword as a layer of the character. As for the body parts they do not need to be separate layers but separate vertex groups.
The simplest obvious answers are always the best while I smack myself in the head doh!
Each layer has a transform panel (after the masks panel) and the arm layer and body layers can be offset on the Y axis to be in between the sword GP. When I rotate the 3D view I can see the layers are spaced apart and the sword GP is in between but there is Z buffer clipping issues (probably a bug).
Your approach manually moving the strokes on the Y axis works perfectly.
Concerning there might be a bug witth the layer transforms being clipped, there is a setting in the Layer Data tab->Settings->Stroke Depth Order. Changing this to 3D Location resolves the clipping.