void ipo_record(void);
void sethandles_ipo_keys(struct Ipo *ipo, int code);
+void setipotype_ipo(struct Ipo *ipo, int code);
void set_ipo_key_selection(struct Ipo *ipo, int sel);
int is_ipo_key_selected(struct Ipo *ipo);
void delete_ipo_keys(struct Ipo *ipo);
allqueue(REDRAWNLA, 0);
}
+static void set_ipotype_actionchannels(void) {
+
+ bAction *act;
+ bActionChannel *chan;
+ short event;
+
+ /* Get the selected action, exit if none are selected
+ */
+ act = G.saction->action;
+ if (!act)
+ return;
+
+ /* Present a popup menu asking the user what type
+ * of IPO curve he/she/GreenBTH wants. ;)
+ */
+ event= pupmenu("Channel Ipo Type %t|Constant %x1|Linear %x2|Bezier %x3");
+ if(event < 1) return;
+
+ /* Loop through the channels and for the selected ones set
+ * the type for each Ipo curve in the channel Ipo (based on
+ * the value from the popup).
+ */
+ for (chan = act->chanbase.first; chan; chan=chan->next){
+ if (chan->flag & ACHAN_SELECTED){
+ if (chan->ipo)
+ setipotype_ipo(chan->ipo, event);
+ }
+ }
+
+ /* Clean up and redraw stuff
+ */
+ remake_action_ipos (act);
+ allspace(REMAKEIPO, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWIPO, 0);
+ allqueue(REDRAWNLA, 0);
+}
void winqreadactionspace(unsigned short event, short val, char ascii)
{
else sethandles_actionchannel_keys(HD_ALIGN);
break;
+ /*** set the Ipo type ***/
+ case TKEY:
+ set_ipotype_actionchannels();
+ break;
+
case BKEY:
borderselect_action();
break;
}
+void set_ipocurve_constant(struct IpoCurve *icu) {
+ /* Sets the type of the IPO curve to constant
+ */
+ icu->ipo= IPO_CONST;
+}
+
+void set_ipocurve_linear(struct IpoCurve *icu) {
+ /* Sets the type of the IPO curve to linear
+ */
+ icu->ipo= IPO_LIN;
+}
+
+void set_ipocurve_bezier(struct IpoCurve *icu) {
+ /* Sets the type of the IPO curve to bezier
+ */
+ icu->ipo= IPO_BEZ;
+}
+
+
+void setipotype_ipo(Ipo *ipo, int code)
+{
+ /* Sets the type of the each ipo curve in the
+ * Ipo to a value based on the code
+ */
+ switch (code) {
+ case 1:
+ ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_constant);
+ break;
+ case 2:
+ ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_linear);
+ break;
+ case 3:
+ ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_bezier);
+ break;
+ }
+}
+
void set_ipotype()
{
EditIpo *ei;