[Bf-taskforce25] Edit Mesh Extrude move to 2.5

Shaul Kedem shaul.kedem at gmail.com
Sun Jan 25 21:49:35 CET 2009


Hi All,

 following a discussion with Ton we wanted your input on how to move
extrude to the new code base.

 void extrude_mesh(void) is built in two main parts, the first one
checks which select mode we use and according to that asks the user to
choose what extrude method he likes:

	if(G.scene->selectmode & SCE_SELECT_VERTEX) {
		if(G.totvertsel==0) nr= 0;
		else if(G.totvertsel==1) nr= 4;
		else if(G.totedgesel==0) nr= 4;
		else if(G.totfacesel==0)
			nr= pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4");
		else if(G.totfacesel==1)
			nr= pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4");
		else
			nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only
Edges%x3|Only Vertices%x4");
	}
	else if(G.scene->selectmode & SCE_SELECT_EDGE) {
		if (G.totedgesel==0) nr = 0;
		else if (G.totedgesel==1) nr = 3;
		else if(G.totfacesel==0) nr = 3;
		else if(G.totfacesel==1)
			nr= pupmenu("Extrude %t|Region %x1|Only Edges%x3");
		else
			nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3");
	}
	else {
		if (G.totfacesel == 0) nr = 0;
		else if (G.totfacesel == 1) nr = 1;
		else
			nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2");

 Now , this is a modal function and if moved like this to the 2.5 it
means the invoke function in the operator will have logic in it. or in
other words, part of the controller will now be in the view.

 To complete the picture, if we take the modal approach, the operator
will use exec to execute what was chosen from the above in the invoke
function.

 So, other ideas? Maybe WM should be aware of our selection and call
the appropriate action (in that case the above is separated into
smaller, more atomic extrude functions)?

Thanks,
Shaul


More information about the Bf-taskforce25 mailing list