[Bf-python] Blender edit modes
Gilbert, Joseph T.
jgilbert at tigr.ORG
Thu Jan 5 16:13:07 CET 2006
I've never understood Window.EditMode().
This methods puts the active object into editmode.
Because editmode is object specific it would seem to me that it would
make a lot more sense to have enter/exit editmode inside each object
type or in the object module. To have this in the window module which is
for windowing functions doesn't seem right.
else if(ob->type==OB_LATTICE) {
G.obedit= ob;
ok= 1;
make_editLatt();
}
Why can't this code be executed in the lattice module or in the object
module?
Because void enter_editmode(void) is found in editobject.c it would seem
like this function would be more appropriate in this area.
#################
Also it seems like the 'modes' you have listed below would apply only to
specific data types. Posemode is only for armatures for instance.
Looking in the code header_view3d.c has code listed at line 3987
starting with:
case B_MODESELECT:
which defines how the selection icon works for entering the different
modes on an object.
else if (G.vd->modeselect == V3D_EDITMODE_SEL) {
if(!G.obedit) {
G.vd->flag &= ~V3D_MODE;
G.f &= ~G_VERTEXPAINT;
G.f &= ~G_TEXTUREPAINT;
if(G.f & G_WEIGHTPAINT)
set_wpaint();
enter_editmode();
BIF_undo_push("Original");
}
}
#######################
I think in the end it might make sense to add the 'modes' code to the
object module instead of the window module.
1) Object.mode = Object.CONSTANT
2) Object.mode: needs to check the object->data to see if mode is
settable
3) you'll have to set OBACT = current object
4) call enter_editmode(), exit_editmode(),enter_posemode(,set_vpaint()
depending on the constant
5) (possibly) set G.f flags (don't know)
Anyway some of my thoughts. Thx ;)
-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Campbell
Barton
Sent: Wednesday, January 04, 2006 10:56 PM
To: bf-python at blender.org
Subject: [Bf-python] Blender edit modes
Could we depricate Window.EditMode() in favor
Window.Mode(Window.Modes['EDITMODE'])
and...
Window.Mode(Window.Modes['OBJECTMODE'])
Window.Mode(Window.Modes['UVFACESELECT'])
Window.Mode(Window.Modes['TEXTUREPAINT'])
Window.Mode(Window.Modes['WEIGHTPAINT'])
Window.Mode(Window.Modes['POSE']).
...
etc
Any non logical action would raise an error.
- Cam
--
Campbell J Barton
133 Hope Street
Geelong West, Victoria 3218 Australia
URL: http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241
_______________________________________________
Bf-python mailing list
Bf-python at projects.blender.org
http://projects.blender.org/mailman/listinfo/bf-python
More information about the Bf-python
mailing list