Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-12-13 11:03:13 +0300
committerJoshua Leung <aligorith@gmail.com>2015-12-13 11:03:13 +0300
commita1f87064c4c0cd9e8eafc19c599c4ad4ccdba49f (patch)
treed016e95050f10eda7bc44e1bdfa2f7c4fc0fc024 /source/blender/editors/transform/transform_conversions.c
parentd9ee88d126ddb59b68d2561694b522a99e4923b6 (diff)
Grease Pencil: Merge GPencil_Editing_Stage3 branch into master
This commit merges all the work done in the GPencil_Editing_Stage3 branch as of ef2aecf2db981b5344e0d14e7f074f1742b0b2f7 into master. For more details about the changes that this brings, see the WIP release notes: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.77/GPencil
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r--source/blender/editors/transform/transform_conversions.c43
1 files changed, 3 insertions, 40 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 16642dec5b0..dc0b153d6e9 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -7767,45 +7767,7 @@ static void createTransGPencil(bContext *C, TransInfo *t)
*/
// XXX: should this be allowed when framelock is enabled?
if (gpf->framenum != cfra) {
- bGPDframe *new_frame = gpencil_frame_duplicate(gpf);
- bGPDframe *gf;
- bool found = false;
-
- /* Find frame to insert it before */
- for (gf = gpf->next; gf; gf = gf->next) {
- if (gf->framenum > cfra) {
- /* Add it here */
- BLI_insertlinkbefore(&gpl->frames, gf, new_frame);
-
- found = true;
- break;
- }
- else if (gf->framenum == cfra) {
- /* This only happens when we're editing with framelock on...
- * - Delete the new frame and don't do anything else here...
- */
- //printf("GP Frame convert to TransData - Copy aborted for frame %d -> %d\n", gpf->framenum, gf->framenum);
- free_gpencil_strokes(new_frame);
- MEM_freeN(new_frame);
- new_frame = NULL;
-
- found = true;
- break;
- }
- }
-
- if (found == false) {
- /* Add new frame to the end */
- BLI_addtail(&gpl->frames, new_frame);
- }
-
- /* Edit the new frame instead, if it did get created + added */
- if (new_frame) {
- // TODO: tag this one as being "newly created" so that we can remove it if the edit is cancelled
- new_frame->framenum = cfra;
-
- gpf = new_frame;
- }
+ gpf = gpencil_frame_addcopy(gpl, cfra);
}
/* Loop over strokes, adding TransData for points as needed... */
@@ -7930,7 +7892,8 @@ void createTransData(bContext *C, TransInfo *t)
}
}
else if (t->options & CTX_GPENCIL_STROKES) {
- t->flag |= T_POINTS; // XXX...
+ t->options |= CTX_GPENCIL_STROKES;
+ t->flag |= T_POINTS;
createTransGPencil(C, t);
if (t->data && (t->flag & T_PROP_EDIT)) {