Extend animation panel frame dispatch
This commit is contained in:
@@ -288,6 +288,8 @@ struct PlanAnimationOperationArgs {
|
||||
int total_duration = 1;
|
||||
int current_frame = 0;
|
||||
int selected_frame = 0;
|
||||
int layer_index = 0;
|
||||
std::uint32_t layer_id = 0;
|
||||
int current_duration = 1;
|
||||
int delta = 1;
|
||||
int offset = 1;
|
||||
@@ -981,12 +983,16 @@ const char* document_animation_operation_name(pp::app::DocumentAnimationOperatio
|
||||
return "adjust-duration";
|
||||
case pp::app::DocumentAnimationOperation::move_frame:
|
||||
return "move-frame";
|
||||
case pp::app::DocumentAnimationOperation::select_frame:
|
||||
return "select-frame";
|
||||
case pp::app::DocumentAnimationOperation::goto_frame:
|
||||
return "goto-frame";
|
||||
case pp::app::DocumentAnimationOperation::goto_next:
|
||||
return "goto-next";
|
||||
case pp::app::DocumentAnimationOperation::goto_previous:
|
||||
return "goto-previous";
|
||||
case pp::app::DocumentAnimationOperation::playback_step:
|
||||
return "playback-step";
|
||||
case pp::app::DocumentAnimationOperation::set_onion_size:
|
||||
return "set-onion-size";
|
||||
}
|
||||
@@ -1547,7 +1553,7 @@ void print_help()
|
||||
<< " plan-layer-rename --old-name NAME --new-name NAME\n"
|
||||
<< " plan-layer-menu --command clear|rename|merge [--no-current-layer] [--current-index N] [--animation-duration N] [--current-name NAME] [--lower-name NAME]\n"
|
||||
<< " plan-layer-operation --kind add|duplicate|select|reorder|remove|opacity|visibility|alpha-lock|blend-mode|highlight [--layer-count N] [--index N] [--from-index N] [--to-index N] [--source-index N] [--name NAME] [--opacity N] [--blend-mode N] [--enabled]\n"
|
||||
<< " plan-animation-operation --kind add|duplicate|remove|duration|move|goto|next|prev|onion [--frame-count N] [--total-duration N] [--current-frame N] [--selected-frame N] [--current-duration N] [--delta N] [--offset N] [--onion-size N]\n"
|
||||
<< " plan-animation-operation --kind add|duplicate|remove|duration|move|select|goto|next|prev|playback|onion [--frame-count N] [--total-duration N] [--current-frame N] [--selected-frame N] [--layer-index N] [--layer-id N] [--current-duration N] [--delta N] [--offset N] [--onion-size N]\n"
|
||||
<< " plan-brush-operation --kind color|tip|pattern|dual|preset|settings [--path FILE] [--thumb FILE] [--r N] [--g N] [--b N] [--a N] [--no-brush]\n"
|
||||
<< " plan-canvas-tool --kind draw|erase|line|camera|grid|copy|cut|fill|mask-free|mask-line|bucket|pick|touch-lock [--current-mode-draw]\n"
|
||||
<< " plan-canvas-tool-state [--mode draw|erase|line|camera|grid|copy|cut|fill|mask-free|mask-line|bucket] [--picking] [--touch-lock]\n"
|
||||
@@ -3853,7 +3859,8 @@ pp::foundation::Status parse_plan_animation_operation_args(
|
||||
args.kind = argv[++i];
|
||||
} else if (key == "--frame-count" || key == "--total-duration" || key == "--current-frame"
|
||||
|| key == "--selected-frame" || key == "--current-duration" || key == "--delta"
|
||||
|| key == "--offset" || key == "--onion-size") {
|
||||
|| key == "--offset" || key == "--onion-size" || key == "--layer-index"
|
||||
|| key == "--layer-id") {
|
||||
if (i + 1 >= argc) {
|
||||
return pp::foundation::Status::invalid_argument("missing value for option");
|
||||
}
|
||||
@@ -3875,8 +3882,15 @@ pp::foundation::Status parse_plan_animation_operation_args(
|
||||
args.delta = value.value();
|
||||
} else if (key == "--offset") {
|
||||
args.offset = value.value();
|
||||
} else {
|
||||
} else if (key == "--onion-size") {
|
||||
args.onion_size = value.value();
|
||||
} else if (key == "--layer-index") {
|
||||
args.layer_index = value.value();
|
||||
} else {
|
||||
if (value.value() < 0) {
|
||||
return pp::foundation::Status::out_of_range("animation layer id must not be negative");
|
||||
}
|
||||
args.layer_id = static_cast<std::uint32_t>(value.value());
|
||||
}
|
||||
} else {
|
||||
return pp::foundation::Status::invalid_argument("unknown option");
|
||||
@@ -3908,6 +3922,13 @@ pp::foundation::Result<pp::app::DocumentAnimationOperationPlan> make_animation_o
|
||||
if (args.kind == "move") {
|
||||
return pp::app::plan_animation_move_frame(args.frame_count, args.selected_frame, args.offset);
|
||||
}
|
||||
if (args.kind == "select") {
|
||||
return pp::app::plan_animation_select_frame(
|
||||
args.frame_count,
|
||||
args.layer_index,
|
||||
args.layer_id,
|
||||
args.selected_frame);
|
||||
}
|
||||
if (args.kind == "goto") {
|
||||
return pp::app::plan_animation_goto_frame(args.total_duration, args.current_frame);
|
||||
}
|
||||
@@ -3917,6 +3938,9 @@ pp::foundation::Result<pp::app::DocumentAnimationOperationPlan> make_animation_o
|
||||
if (args.kind == "prev") {
|
||||
return pp::app::plan_animation_step_frame(args.total_duration, args.current_frame, -1);
|
||||
}
|
||||
if (args.kind == "playback") {
|
||||
return pp::app::plan_animation_playback_step(args.total_duration, args.current_frame, args.offset);
|
||||
}
|
||||
if (args.kind == "onion") {
|
||||
return pp::app::plan_animation_onion_size(args.onion_size);
|
||||
}
|
||||
@@ -3947,6 +3971,8 @@ int plan_animation_operation(int argc, char** argv)
|
||||
<< ",\"totalDuration\":" << args.total_duration
|
||||
<< ",\"currentFrame\":" << args.current_frame
|
||||
<< ",\"selectedFrame\":" << args.selected_frame
|
||||
<< ",\"layerIndex\":" << args.layer_index
|
||||
<< ",\"layerId\":" << args.layer_id
|
||||
<< ",\"currentDuration\":" << args.current_duration
|
||||
<< ",\"delta\":" << args.delta
|
||||
<< ",\"offset\":" << args.offset
|
||||
@@ -3956,6 +3982,8 @@ int plan_animation_operation(int argc, char** argv)
|
||||
<< ",\"currentFrame\":" << value.current_frame
|
||||
<< ",\"selectedFrame\":" << value.selected_frame
|
||||
<< ",\"targetFrame\":" << value.target_frame
|
||||
<< ",\"layerIndex\":" << value.layer_index
|
||||
<< ",\"layerId\":" << value.layer_id
|
||||
<< ",\"frameDuration\":" << value.frame_duration
|
||||
<< ",\"durationDelta\":" << value.duration_delta
|
||||
<< ",\"moveOffset\":" << value.move_offset
|
||||
|
||||
Reference in New Issue
Block a user