Another idea is to use SET_NOW if get_shooting() is true, and SET_LATER if it isn't. It sound like it would work. What am I missing?
Since set_now just sets the propcase, this needs to happen in a particular point in the shooting process, it seems to me exposing at as an option to set_tv96_direct would just add confusion without much value.
Another idea is to use SET_NOW if get_shooting() is true, and SET_LATER if it isn't. It sound like it would work. What am I missing?QuoteThis would make more sense, although one thing to watch out for is when get_shooting goes back to false.
This would make more sense, although one thing to watch out for is when get_shooting goes back to false.
static int now_flag=0;static int when(){ if(now_flag&&shooting_in_progress())return SET_NOW; return SET_LATER;}extern void set_later() //called in script.c before script starts{ now_flag=0;}//also need new lua function set_now() that just does: now_flag==1;
static int now_flag=0;static int when(){ if(now_flag&&shooting_in_progress())return SET_NOW; return SET_LATER;}...int lua_script_start( char const* script, int ptp ){ now_flag=0; //set_tv,sv,av default to SET_LATER...static int luaCB_set_now_flag( lua_State* L ){ now_flag = luaL_checknumber( L, 1 ) != 0; //set_now_flag(1) means all calls to set_tv,sv,av functions take place immediately if shooting_in_progress() return 0;}static int luaCB_set_sv96( lua_State* L ){ shooting_set_sv96(luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_tv96_direct( lua_State* L ){ shooting_set_tv96_direct(luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_tv96( lua_State* L ){ shooting_set_tv96(luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_iso_real( lua_State* L ){ shooting_set_iso_real( luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_av96_direct( lua_State* L ){ shooting_set_av96_direct( luaL_checknumber( L, 1 ), when() ); return 0;}static int luaCB_set_av96( lua_State* L ){ shooting_set_av96( luaL_checknumber( L, 1 ), when() ); return 0;}static int luaCB_set_nd_filter( lua_State* L ){ shooting_set_nd_filter_state( luaL_checknumber( L, 1 ), when()); return 0;}... FUNC(set_now_flag)
Here are the proposed code changes. It looks like I can reset the now_flag in lua_script_start() instead of adding a function to call from script.c. Also, I named the function "set_now_flag()" instead of "set_now()." My reaction to "set_now()" was, "set_what_now()?"Code: [Select]static int now_flag=0;static int when(){ if(now_flag&&shooting_in_progress())return SET_NOW; return SET_LATER;}...int lua_script_start( char const* script, int ptp ){ now_flag=0; //set_tv,sv,av default to SET_LATER...static int luaCB_set_now_flag( lua_State* L ){ now_flag = luaL_checknumber( L, 1 ) != 0; //set_now_flag(1) means all calls to set_tv,sv,av functions take place immediately if shooting_in_progress() return 0;}static int luaCB_set_sv96( lua_State* L ){ shooting_set_sv96(luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_tv96_direct( lua_State* L ){ shooting_set_tv96_direct(luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_tv96( lua_State* L ){ shooting_set_tv96(luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_iso_real( lua_State* L ){ shooting_set_iso_real( luaL_checknumber( L, 1 ), when()); return 0;}static int luaCB_set_av96_direct( lua_State* L ){ shooting_set_av96_direct( luaL_checknumber( L, 1 ), when() ); return 0;}static int luaCB_set_av96( lua_State* L ){ shooting_set_av96( luaL_checknumber( L, 1 ), when() ); return 0;}static int luaCB_set_nd_filter( lua_State* L ){ shooting_set_nd_filter_state( luaL_checknumber( L, 1 ), when()); return 0;}... FUNC(set_now_flag)[edit] I just tested the above routines with my time lapse script and set_tv96_direct(tv). It worked fine, just like with propcases, as expected. I need to test it with set_sv96(sv) to see if that also works as expected.
static int when(){ if(kbd_is_key_pressed(KEY_SHOOT_HALF))return SET_NOW; return SET_LATER;}
static int when(){ if(camera_info.state.is_shutter_half_press)return SET_NOW; return SET_LATER;}
Maybe I'm missing something obvious; but if this only applies if trying to set values when the shutter is half pressed why not just test that?
Started by Barney Fife General Chat
Started by mattkime Script Writing
Started by bugsplatter « 1 2 » Script Writing
Started by outslider RAW Shooting and Processing
Started by waterwingz « 1 2 » General Discussion and Assistance