Page MenuHome

Fix T64058: Grease Pencil Object saved in editmode is not appended in objectmode correctly
ClosedPublic

Authored by Antonio Vazquez (antoniov) on Feb 5 2020, 11:02 PM.

Details

Summary

Looks like we need to make sure GP_DATA_STROKE_EDITMODE flag is cleared,
otherwise this will be picked up by GPENCIL_EDIT_MODE() and will be
interpreted as being in editmode in a couple of places (e.g. transform
context will be set incorrectly to CTX_GPENCIL_STROKES).

Not sure if this is the best place for this?
(I've looked at 'direct_link_gpencil' or 'lib_link_gpencil' but these
are also called when opening a file, so we dont want to loose proper
editmode in that case...)

Diff Detail

Repository
rB Blender
Branch
arcpatch-D6759 (branched from master)
Build Status
Buildable 6504
Build 6504: arc lint + arc unit

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Feb 6 2020, 2:59 AM
This revision was automatically updated to reflect the committed changes.
  • Revert "Fix T69776: Error with complex Eevee noise texture in some drivers"

@Philipp Oeser (lichtwerk) @Germano Cavalcante (mano-wii) If this is the right place to make the fix, I can handle this bug.

source/blender/blenloader/intern/readfile.c
11865

need too: GP_DATA_STROKE_PAINTMODE GP_DATA_STROKE_SCULPTMODE GP_DATA_STROKE_WEIGHTMODE

if (ob->type == OB_GPENCIL) {
      bGPdata *gpd = (bGPdata *)ob->data;
      gpd->flag &= ~GP_DATA_STROKE_PAINTMODE;
      gpd->flag &= ~GP_DATA_STROKE_EDITMODE;
      gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE;
      gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE;
    }

also clear other flags (thx @Antonio Vazquez (antoniov) for the heads up)

@Antonio Vazquez (antoniov) : updated with the other flags.
regarding the best place to do this: I think @Bastien Montagne (mont29) would know best...

Bastien Montagne (mont29) requested changes to this revision.EditedFeb 6 2020, 11:10 AM

Not exactly thrilled to have that here, and to be looping over objects for some specific obdata thing...

Can't you simply do that in direct_link_gpencil(), behind an if (gpd->id.lib != NULL)?

This revision now requires changes to proceed.Feb 6 2020, 11:10 AM

Updating D6759: Fix T64058: Grease Pencil Object saved in editmode is not appended in objectmode correctly

This revision was not accepted when it landed; it landed in state Needs Review.Feb 6 2020, 11:31 AM
This revision was automatically updated to reflect the committed changes.

@Bastien Montagne (mont29): that if (gpd->id.lib != NULL) was the one I was looking for, thx!
@Antonio Vazquez (antoniov): talked about the comment (add "If linking from a library"), other than that, go ahead

LGTM now.

source/blender/blenloader/intern/readfile.c
7230

Ensure full objectmode for linked grease pencil.