#ポリゴンメッシュの選択してる二頂点間にエッジを張るスクリプト #active_orderの欠番バグを修正したバージョン #上位パートに変換がかかっていると使用できないように変更(2010.03.03) dousasuru=1 if dousasuru>0: #上位パートに変換がかかっているなら動作しない if xshade.scene().active_shape().local_to_world_matrix!=((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0)): dousasuru=0 dialog=xshade.create_dialog() dialog.append_push_button('上位パートに変換がかかっているため') dialog.append_push_button('スクリプトが実行できません') dialog.ask('エラー') #まずは選択してる頂点の数が二点のみかどうか(二点以外は実行しない) if xshade.scene().selection_mode==2 and dousasuru==1: if xshade.scene().active_shape().number_of_active_control_points==2 and xshade.scene().active_shape().type==7 and xshade.scene().is_modify_mode==True: #総頂点数をカウントして変数totalverに入れる totalver=xshade.scene().active_shape().total_number_of_control_points #選択している二頂点の頂点番号をtyouten1,tyouten2に格納 i=0 tyoutensuu=0 while(i0: if tyoutensuu==0: tyouten1=i tyoutensuu=1 else: tyouten2=i # if xshade.scene().active_shape().vertex(i).active_order==2: # tyouten2=i i=i+1 #二頂点間にすでにエッジが張られていないかチェックしてからエッジを張る totaledge=xshade.scene().active_shape().number_of_edges edgearu=0 #まだ張られてないなら0、すでに張られてるなら1 i=0 while(i