diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-11 11:12:54 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-11 11:12:54 +0300 |
commit | 1dfc7942d3f35cbb8bb0e94fec57828da0eb756c (patch) | |
tree | 4b3c51a8c36725c31de241ee8e81637d5b61d80f /source/blender/editors/gpencil/gpencil_edit.c | |
parent | 7206437c7247040c7b3f00d7b76c715103282c4c (diff) |
Grease Pencil for Nodes Editor:
This commit restores Grease Pencil functionality for the Nodes Editor. Grease Pencil data is now stored at the NodeTree level, which means that annotations remain with the NodeTree they were made for.
Possible TODO's:
* In future, it may be worth investigating attaching Grease Pencil data to individual nodes, to allow annotations to stay attached to nodes as they are moved
* Include the settings for the 'active node' in a panel in the new NKEY region where the Grease Pencil buttons appear.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 1358ed80f7a..c2b9a1a4bb9 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -45,6 +45,7 @@ #include "DNA_curve_types.h" #include "DNA_gpencil_types.h" #include "DNA_object_types.h" +#include "DNA_node_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" @@ -113,9 +114,18 @@ bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr) case SPACE_NODE: /* Nodes Editor */ { - //SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C); + SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C); /* return the GP data for the active node block/node */ + if (snode && snode->nodetree) { + /* for now, as long as there's an active node tree, default to using that in the Nodes Editor */ + if (ptr) RNA_id_pointer_create(&snode->nodetree->id, ptr); + return &snode->nodetree->gpd; + } + else { + /* even when there is no node-tree, don't allow this to flow to scene */ + return NULL; + } } break; |