made editmode select grouped work with mixed selections - can show select grouped items for vert/edges/faces all at once.
bad comment in Axiscopy and spelling fix in export_obj
This commit is contained in:
@@ -103,7 +103,6 @@ def main():
|
|||||||
Draw.PupMenu("Error%t|Meshes must be single user")
|
Draw.PupMenu("Error%t|Meshes must be single user")
|
||||||
return
|
return
|
||||||
|
|
||||||
# remove linked
|
|
||||||
if len(obs) < 1:
|
if len(obs) < 1:
|
||||||
Draw.PupMenu("Error: you must select at least 2 objects")
|
Draw.PupMenu("Error: you must select at least 2 objects")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -171,7 +171,11 @@ def copy_images(dest_dir):
|
|||||||
# Get MTex images
|
# Get MTex images
|
||||||
if matname != None:
|
if matname != None:
|
||||||
mat= Material.Get(matname)
|
mat= Material.Get(matname)
|
||||||
for mtex in mat.getTextures():
|
for mtex in mat.getTex* The ambient and emit data we can retrieve from Blender are single values, that this script copies to an RGB triplet, giving shades of gray. A config option can be set to export RGB mirror color as either or both.
|
||||||
|
* In AC3D 4 "compatibility mode":
|
||||||
|
** Shininess of materials is taken from the shader specularity value in Blender, mapped from [0.0, 2.0] to [0, 128].
|
||||||
|
** Crease angle is exported, but in Blender it is limited to [1, 80], since there are other more powerful ways to control surface smoothing. In AC3D 4.0 crease's range is [0.0, 180.0].
|
||||||
|
* Blender groups are not supported yet.tures():
|
||||||
if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
|
if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
|
||||||
try:
|
try:
|
||||||
uniqueImages[mtex.tex.image.name] = None
|
uniqueImages[mtex.tex.image.name] = None
|
||||||
@@ -526,7 +530,7 @@ def write_ui(filename):
|
|||||||
pup_block = [\
|
pup_block = [\
|
||||||
('Context...'),\
|
('Context...'),\
|
||||||
('Selection Only', EXPORT_SEL_ONLY, 'Only export objects in visible selection. Else export whole scene.'),\
|
('Selection Only', EXPORT_SEL_ONLY, 'Only export objects in visible selection. Else export whole scene.'),\
|
||||||
('All Scenes', EXPORT_ALL_SCENES, 'Each scene as a seperate OBJ file.'),\
|
('All Scenes', EXPORT_ALL_SCENES, 'Each scene as a separate OBJ file.'),\
|
||||||
('Animation', EXPORT_ANIMATION, 'Each frame as a numbered OBJ file.'),\
|
('Animation', EXPORT_ANIMATION, 'Each frame as a numbered OBJ file.'),\
|
||||||
('Object Prefs...'),\
|
('Object Prefs...'),\
|
||||||
('Apply Modifiers', EXPORT_APPLY_MODIFIERS, 'Use transformed mesh data from each object. May break vert order for morph targets.'),\
|
('Apply Modifiers', EXPORT_APPLY_MODIFIERS, 'Use transformed mesh data from each object. May break vert order for morph targets.'),\
|
||||||
|
|||||||
@@ -1205,26 +1205,47 @@ int vertgroup_select(short mode)
|
|||||||
handles face/edge vert context and
|
handles face/edge vert context and
|
||||||
facegroup_select/edgegroup_select/vertgroup_select do all the work
|
facegroup_select/edgegroup_select/vertgroup_select do all the work
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void select_mesh_group_menu()
|
void select_mesh_group_menu()
|
||||||
{
|
{
|
||||||
short ret;
|
short ret;
|
||||||
int selcount;
|
int selcount, first_item=1;
|
||||||
|
char str[512] = "Select Grouped%t"; /* total max length is 392 at the moment */
|
||||||
|
|
||||||
|
if(G.scene->selectmode & SCE_SELECT_VERTEX) {
|
||||||
|
first_item=0;
|
||||||
|
strcat(str, "|Verts...| Similar Normal %x1| Same Face Users %x2| Shared Vertex Groups%x3");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(G.scene->selectmode & SCE_SELECT_EDGE) {
|
||||||
|
if (!first_item) strcat(str, "|%l");
|
||||||
|
else first_item=1;
|
||||||
|
|
||||||
|
strcat(str, "|Edges...| Similar Length %x10| Similar Direction %x20| Same Face Users%x30| Similar Face Angle%x40| Similar Crease%x50");
|
||||||
|
}
|
||||||
|
|
||||||
if(G.scene->selectmode & SCE_SELECT_FACE) {
|
if(G.scene->selectmode & SCE_SELECT_FACE) {
|
||||||
ret= pupmenu("Select Grouped Faces %t|Same Material %x1|Same Image %x2|Similar Area %x3|Similar Perimeter %x4|Similar Normal %x5|Similar Co-Planer %x6");
|
if (!first_item) strcat(str, "|%l");
|
||||||
if (ret<1) return;
|
strcat(str, "|Faces...| Same Material %x100| Same Image %x200| Similar Area %x300| Similar Perimeter %x400| Similar Normal %x500| Similar Co-Planer %x600");
|
||||||
selcount= facegroup_select(ret);
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ret= pupmenu(str);
|
||||||
|
if (ret<1) return;
|
||||||
|
|
||||||
|
if (ret<10) {
|
||||||
|
selcount= vertgroup_select(ret);
|
||||||
if (selcount) { /* update if data was selected */
|
if (selcount) { /* update if data was selected */
|
||||||
G.totfacesel+=selcount;
|
EM_select_flush(); /* so that selected verts, go onto select faces */
|
||||||
|
G.totvertsel += selcount;
|
||||||
allqueue(REDRAWVIEW3D, 0);
|
allqueue(REDRAWVIEW3D, 0);
|
||||||
BIF_undo_push("Select Grouped Faces");
|
BIF_undo_push("Select Grouped Verts");
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} else if(G.scene->selectmode & SCE_SELECT_EDGE) {
|
if (ret<100) {
|
||||||
ret= pupmenu("Select Grouped Edges%t|Similar Length %x1|Similar Direction %x2|Same Face Users%x3|Similar Adjacent Face Angle%x4|Similar Crease%x5");
|
selcount= edgegroup_select(ret/10);
|
||||||
if (ret<1) return;
|
|
||||||
selcount= edgegroup_select(ret);
|
|
||||||
|
|
||||||
if (selcount) { /* update if data was selected */
|
if (selcount) { /* update if data was selected */
|
||||||
/*EM_select_flush();*/ /* dont use because it can end up selecting more edges and is not usefull*/
|
/*EM_select_flush();*/ /* dont use because it can end up selecting more edges and is not usefull*/
|
||||||
@@ -1232,20 +1253,18 @@ void select_mesh_group_menu()
|
|||||||
allqueue(REDRAWVIEW3D, 0);
|
allqueue(REDRAWVIEW3D, 0);
|
||||||
BIF_undo_push("Select Grouped Edges");
|
BIF_undo_push("Select Grouped Edges");
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
} else if(G.scene->selectmode & SCE_SELECT_VERTEX) {
|
|
||||||
ret= pupmenu("Select Grouped Verts%t|Similar Normal %x1|Same Face Users %x2|Shared Vertex Groups%x3");
|
|
||||||
if (ret<1) return;
|
|
||||||
selcount= vertgroup_select(ret);
|
|
||||||
|
|
||||||
if (selcount) { /* update if data was selected */
|
|
||||||
EM_select_flush(); /* so that selected verts, go onto select faces */
|
|
||||||
G.totedgesel+=selcount;
|
|
||||||
allqueue(REDRAWVIEW3D, 0);
|
|
||||||
BIF_undo_push("Select Grouped Verts");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret<1000) {
|
||||||
|
selcount= facegroup_select(ret/100);
|
||||||
|
if (selcount) { /* update if data was selected */
|
||||||
|
G.totfacesel+=selcount;
|
||||||
|
allqueue(REDRAWVIEW3D, 0);
|
||||||
|
BIF_undo_push("Select Grouped Faces");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user