Page MenuHome

Fix T69459: Convert Curve to Grease Pencil clears Transform

Authored by Antonio Vazquez (antoniov) on Thu, Oct 10, 10:22 PM.

Diff Detail

rB Blender
temp-curve-gpencil (branched from master)
Build Status
Buildable 5335
Build 5335: arc lint + arc unit

Event Timeline


I could use here the ob->loc and remove any reference to cursor location.

Indeed you should, it makes no sense to pass the cursor just to transform it afterwards.

As for the API I don't know, copying obmat should work no idea why is not in this case. But poke @Campbell Barton (campbellbarton) on, he knows the matrix/copy API inside out way better than me.

Now what bothers me about this (although unrelated) is that when converting it should "delete" the original object.

  • GPencil: Remove cursor location and use object location

@Dalai Felinto (dfelinto) I have talked with @Jeroen Bakker (jbakker) and he confirmed the right way to do the things is copying the rotation and scale because the matrix is recalculated using these values. I think we could apply this patch and make a different patch for removing the converted curve, as this is not related to this bug.

Remove original Curve object when converting to Strokes

I have been doing some tests and it was very easy to remove the converted objects, so we could include both changes in the same patch.

  • Delete line copied by error in previous commit

I have seen a problem with copying the transformation of the converted curve to GPencil object. If you convert one curve only, it works great, but if you select several curves, all of them are converted in the same grease pencil object and this is logic because we want all curves as strokes of the same object. The problem copying the transformation is that all curves are transformed with the first object and the original curves as transformed.
Original curves:

Converted to 4 strokes:

Not sure, but maybe the solution would be undo the transformation of the 2nd, 3rd, etc curve and use the original transformation of the first curve, but this could change the drawing if sencodary curves are transformed.
@Dalai Felinto (dfelinto) @Matias Mendiola (mendio) Ideas?

Testing the code, maybe the solution is create one GPencil object as curve and let the user join the objects. In this way all will work as Blender does with all conversions.

  • Create one grease pencil object by curve

if the user wants to join all, he can join the curves before conversion or join the strokes after conversion.

Example joining the curves and then converting:

The original curve is removed also.

I just glanced at your replies, but some comments:
It is better to remove the object as a separate patch (sorry for mixing things up).

As for multiple curves follow what blender does for meshes and curves. (I won't be able to test this today I'm afraid, but feel free to commit to blender2.81 if you think you got it).