Hi, Advance Thanks for your valuable reply.
In this Folder source / blender / windowmanager / intern /
File : wm_operators.c
In this file, this WM_OT_quit_blender function calls every operator functions like wm_exit_blender_op, wm_console_toggle_op, wm_save_as_mainfile_exec through invoke or exec or check but I can't call any other operator functions like wm_save_mainfile_invoke within wm_exit_blender_op. Why? what I have do for this. I have to execute the save mainfile function within the exit_blender function. Whats solution for this. Pls refer the following code.
static int wm_exit_blender_op(bContext *C, wmOperator *op)
{
// Here, I can't call functions like wm_save_mainfile_invoke why>
WM_operator_free(op);
WM_exit(C);
return OPERATOR_FINISHED;
}
static void WM_OT_quit_blender(wmOperatorType *ot)
{
ot->name = "Quit Blender";
ot->idname = "WM_OT_quit_blender";
ot->description = "Quit Blender";
ot->invoke = WM_operator_confirm;
ot->exec = wm_exit_blender_op;
ot->poll = WM_operator_winactive;
}
Thanks
projectvismaya.com
Operators functions wont call in c
Moderators: jesterKing, stiv
-
- Posts: 0
- Joined: Sat Oct 05, 2013 11:44 am
- Location: INDIA
-
- Posts: 0
- Joined: Sat Oct 05, 2013 11:44 am
- Location: INDIA
Ya Thanks I know this temp saved. But I'm trying to execute this lineCoDEmanX wrote:blender saves to .blend if you close blender, check quit.blend
ot->exec = wm_save_mainfile;
in to this operator function
static int wm_exit_blender_op(bContext *C, wmOperator *op)
{
- - - - - ;
}
But I can't. How its possible? or Shall I create a NEW operator like WM_OT_quit_blender(wmOperatorType *ot) what are the steps I have to follow, Is there any link for this?
FOR YOUR UNDERSTAND : I'm trying to show save option directly while closing the blender only if user have made any changes in Blender.
calling an operator from within another operator in C doesn't sound like good practise. You may check the automatic saving feature (quit.blend) and see how that is called / executed. You might have to use some functions but not operators.
I'm sitting, waiting, wishing, building Blender in superstition...