Skip to content
Browse files

Merge remote branch 'origin/dgud/bugfixes'

  • Loading branch information...
2 parents a196025 + b1c0843 commit c71ebcc8da8b401ab35720bf8ff945f235240c57 @dgud dgud committed Nov 13, 2011
Showing with 29 additions and 17 deletions.
  1. +8 −2 plugins_src/autouv/wpc_autouv.erl
  2. +13 −12 src/wings_sel_cmd.erl
  3. +8 −3 src/wings_vec.erl
View
10 plugins_src/autouv/wpc_autouv.erl
@@ -1802,15 +1802,21 @@ stretch(Dir,We) ->
reunfold(Method,#st{sel=Sel,selmode=vertex}=St0) ->
%% Check correct pinning.
- Ch = fun(Vs, _, _) ->
+ Ch = fun(Vs, #we{vp=Vtab}, _) ->
case gb_sets:size(Vs) of
N when N /= 2, Method == sphere ->
E = ?__(1,"Select two vertices, the North and South pole"),
wpa:error_msg(E);
N when N < 2 ->
E = ?__(2,"At least two vertices per chart must be pinned"),
wpa:error_msg(E);
- _-> ok
+ N ->
+ case N < wings_util:array_entries(Vtab) of
+ true -> ok;
+ _ ->
+ E = ?__(5,"All vertices can not be pinned"),
+ wpa:error_msg(E)
+ end
end
end,
wings_sel:fold(Ch, ok, St0),
View
25 src/wings_sel_cmd.erl
@@ -380,11 +380,11 @@ by_command({nonplanar_faces,Ask}, St) ->
by_command({vertices_with,N}, St) ->
vertices_with(N, St);
by_command({non_quad,all}, St) ->
- {save_state,faces_with({non_quad,all}, St)};
+ faces_with({non_quad,all}, St);
by_command({non_quad,odd}, St) ->
- {save_state,faces_with({non_quad,odd}, St)};
+ faces_with({non_quad,odd}, St);
by_command({non_quad,even}, St) ->
- {save_state,faces_with({non_quad,even}, St)};
+ faces_with({non_quad,even}, St);
by_command({faces_with,N}, St) ->
faces_with({faces_with,N}, St);
by_command(material_edges, St) ->
@@ -1697,14 +1697,14 @@ faces_with(Filter, #st{sel=[]}=St) ->
faces_with(Filter, #st{selmode=Mode}=St0) ->
St = if Mode =:= face -> St0; true -> wings_sel_conv:mode(face, St0) end,
Sel = wings_sel:fold(fun(Sel0, #we{id=Id}=We, Acc) ->
- Sel1 = gb_sets:to_list(Sel0),
- Faces = [Face || Face <- Sel1, faces_with(Filter, Face, We)],
- case Faces of
- [] -> Acc;
- _ -> [{Id,gb_sets:from_list(Faces)}|Acc]
- end
- end, [], St),
- {save_state,wings_sel:set(face,Sel,St0)}.
+ Sel1 = gb_sets:to_list(Sel0),
+ Faces = [Face || Face <- Sel1, faces_with(Filter, Face, We)],
+ case Faces of
+ [] -> Acc;
+ _ -> [{Id,gb_sets:from_list(Faces)}|Acc]
+ end
+ end, [], St),
+ {save_state,wings_sel:set(face,Sel,St0)}.
faces_with(Filter, Face, We) ->
Vs = wings_face:vertices(Face, We),
@@ -1727,4 +1727,5 @@ select_nth_ring(#st{selmode=edge}) ->
fun([Res]) ->
{select,{edge_loop,{nth_edge_ring,Res}}}
end);
-select_nth_ring(St) -> {save_state,St}.
+select_nth_ring(St) -> {save_state,St}.
+
View
11 src/wings_vec.erl
@@ -263,9 +263,14 @@ handle_event_4(_Event, Ss, St) ->
get_event(Ss, St).
temp_selection(X, Y, St0) ->
- case wings_pick:do_pick(X, Y, St0) of
- {add,_,St} -> St;
- _ -> none
+ case St0 of
+ #st{sel=[{_,_}|_]} ->
+ none;
+ _ ->
+ case wings_pick:do_pick(X, Y, St0) of
+ {add,_,St} -> St;
+ _ -> none
+ end
end.
pick_next(Do, Done, #ss{is_axis=true,vec={{_,_,_},{_,_,_}}=Vec}=Ss, St) ->

0 comments on commit c71ebcc

Please sign in to comment.
Something went wrong with that request. Please try again.