diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-06-12 16:55:44 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-06-12 16:55:44 +0400 |
commit | ba3a1067fa831d8fa7812049a1c3ee08a6b27bd9 (patch) | |
tree | e9cdb13181aafed2be1ce97f1b063d83f7a42dc7 /source/blender | |
parent | 22d2faccefb3b44f5f4b6372e4d114c44f27e194 (diff) |
Remove magic constants from Track Position node RNA code.
Diffstat (limited to 'source/blender')
4 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index ec0dd11392d..587acb8f0d7 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -917,6 +917,10 @@ void ntreeGPUMaterialNodes(struct bNodeTree *ntree, struct GPUMateria #define CMP_SCALE_RENDERSIZE_FRAME_ASPECT (1 << 0) #define CMP_SCALE_RENDERSIZE_FRAME_CROP (1 << 1) +/* track position node, in custom1 */ +#define CMP_TRACKPOS_ABSOLUTE 0 +#define CMP_TRACKPOS_RELATIVE_START 1 +#define CMP_TRACKPOS_RELATIVE_FRAME 2 /* API */ struct CompBuf; diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp index e647ae975ff..4f00358633a 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp @@ -31,6 +31,7 @@ extern "C" { #include "BKE_movieclip.h" + #include "BKE_node.h" #include "BKE_tracking.h" } @@ -42,7 +43,7 @@ TrackPositionOperation::TrackPositionOperation() : NodeOperation() this->m_trackingObjectName[0] = 0; this->m_trackName[0] = 0; this->m_axis = 0; - this->m_position = POSITION_ABSOLUTE; + this->m_position = CMP_TRACKPOS_ABSOLUTE; this->m_relativeFrame = 0; } @@ -77,7 +78,7 @@ void TrackPositionOperation::initExecution() copy_v2_v2(this->m_markerPos, marker->pos); - if (this->m_position == POSITION_RELATIVE_START) { + if (this->m_position == CMP_TRACKPOS_RELATIVE_START) { int i; for (i = 0; i < track->markersnr; i++) { @@ -90,7 +91,7 @@ void TrackPositionOperation::initExecution() } } } - else if (this->m_position == POSITION_RELATIVE_FRAME) { + else if (this->m_position == CMP_TRACKPOS_RELATIVE_FRAME) { int relative_clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip, this->m_relativeFrame); diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.h b/source/blender/compositor/operations/COM_TrackPositionOperation.h index b934719a92b..3f05b907ea0 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.h +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.h @@ -39,12 +39,6 @@ */ class TrackPositionOperation : public NodeOperation { protected: - enum { - POSITION_ABSOLUTE = 0, - POSITION_RELATIVE_START, - POSITION_RELATIVE_FRAME - }; - MovieClip *m_movieClip; int m_framenumber; char m_trackingObjectName[64]; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 04051cf3418..5230390bf00 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -5714,9 +5714,12 @@ static void def_cmp_trackpos(StructRNA *srna) PropertyRNA *prop; static EnumPropertyItem position_items[] = { - {0, "ABSOLUTE", 0, "Absolute", "Output absolute position of a marker"}, - {1, "RELATIVE_START", 0, "Relative Start", "Output position of a marker relative to first marker of a track"}, - {2, "RELATIVE_FRAME", 0, "Relative Frame", "Output position of a marker relative to marker at given frame number"}, + {CMP_TRACKPOS_ABSOLUTE, "ABSOLUTE", 0, + "Absolute", "Output absolute position of a marker"}, + {CMP_TRACKPOS_RELATIVE_START, "RELATIVE_START", 0, + "Relative Start", "Output position of a marker relative to first marker of a track"}, + {CMP_TRACKPOS_RELATIVE_FRAME, "RELATIVE_FRAME", 0, + "Relative Frame", "Output position of a marker relative to marker at given frame number"}, {0, NULL, 0, NULL, NULL} }; |