[Bf-committers] Problems with python menus

Peter den Bak bf-committers@blender.org
Thu, 29 Jul 2004 21:02:29 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_007F_01C475AF.5C2E20B0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Thanks Willian,

I tested your patch, and it works fine.
I've attached your patch to this mail, but now in unified format.
Hope someone can (will) commit it.

Regards,

Peter


-----Original Message-----
From: bf-committers-admin@blender.org
[mailto:bf-committers-admin@blender.org] On Behalf Of Willian Padovani
Germano
Sent: Thursday, July 29, 2004 6:21 PM
To: bf-committers@blender.org
Subject: Re: [Bf-committers] Problems with python menus

Hi Peter, good catch

----- Original Message -----
From: "Peter den Bak" <blender.reply.for.peter@xs4all.nl>
To: <bf-committers@blender.org>
Sent: Thursday, July 29, 2004 10:12 AM
Subject: [Bf-committers] Problems with python menus


> Hi,
>
> Found a problem:
> Start blender press P press ESC, now look at the help menu and the import
> and export scripts.
> There gone.....
>
> Probably has something to do with the game engine reinitializing Python.

Yes, bpython init is done in two steps.  space.c re-inits with
BPY_start_python(), but
didn't call BPY_post_start_python() after it.  After 2.34 we'll test
removing this part of the code, so that normal bpython scripts can access
the game engine api, but for now simply adding the missing command should
solve the problem.

I don't know if this can still be committed, it's already Thursday.  If
there's still time or some developer got an OK to commit some other fix,
diff is at the end of this msg.  BTW: there are two buttons in Blender that
can be used to update the scripts menus, one at the Info window, to the
right of the user pref scripts dir and a menu entry at the Scripts space.

--
Willian, wgermano@ig.com.br
--

Index: source/blender/src/space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.159
diff -r1.159 space.c
471a472
>  BPY_post_start_python(); /* userpref path and menus init */

_______________________________________________
Bf-committers mailing list
Bf-committers@blender.org
http://www.blender.org/mailman/listinfo/bf-committers

------=_NextPart_000_007F_01C475AF.5C2E20B0
Content-Type: application/octet-stream;
	name="fix.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="fix.diff"

Index: space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.159
diff -u -r1.159 space.c
--- space.c	29 Jul 2004 05:03:02 -0000	1.159
+++ space.c	29 Jul 2004 18:56:28 -0000
@@ -469,6 +469,7 @@
 	/* Restart BPY - unload the game engine modules. */
 	BPY_end_python();
 	BPY_start_python();
+	BPY_post_start_python(); /* userpref path and menus init */
 
 	restore_all_scene_cfra(scene_cfra_store);
 	set_scene_bg(startscene);


------=_NextPart_000_007F_01C475AF.5C2E20B0--