poly 定点于mesh定点的法线对其,非开做比较好,要是来回转很费时间, 界面还打伤元气

---工具这样来回的传还是觉得不是很方便,
---我想如果是mesh 就做mesh 的事情,是poly 就做poly 的事情
--这样就会好,画面就不更新 频繁了,还有 点的的对其好事用 自身的号,

 vertesArray =#()
   NamlArray =#()
if classOf $ == Editable_mesh then
(
 
 if subobjectLevel==1  then
 (
  dateArray =  getVertSelection $
  dateArray = dateArray as array
 if dateArray.count >1 then
  (
   for i in 1 to dateArray.count do
     (
        vertsPos = getVert  $ dateArray[i] ---顶点坐标。
      append vertesArray  vertsPos
        Nml_pos =   getNormal   $  dateArray[i]  ---法线方向
      append  NamlArray  Nml_pos
     )
  subobjectLevel = 4
    oop =$ .numfaces
    $.selectedFaces = #{1..oop}
   for i in 1 to oop do
   (
     setFaceSmoothGroup $ i  5  ----设置光滑组。
   )
   update  $
   subobjectLevel = 1
         normal_array =NamlArray
           poly_verects_array=vertesArray

  for i in 1 to dateArray.count do ---在顶点数量中找。
     (    
      local testRay = ray poly_verects_array[i]   -normal_array[i] ----这里面加负号就是负方向处理。
      int_point= intersectRay (getNodeByName  gt_5_mode_Cloce.handNalbtn1.text )  testRay

      if int_point != undefined and  int_point != ok then
    (
     ----应该是设置的点的坐标 到新的位置上去。
     
    ray_pos_point = (int_point.pos)---int_point.pos 射线的位置
    setVert $  dateArray[i]  ray_pos_point
    )
     )--end i loop
      --max modify mode
    setVertSelection  $  #()
          update $
  )
 )

)---end classof

if classOf $ == Editable_Poly then
(
  if subobjectLevel==1  then
 (
    ResetXForm  $
  convertToPoly $
  oop = $.mesh
  
  
  
  dateArray =  getVertSelection oop
  dateArray = dateArray as array
 if dateArray.count >1 then
  (
   for i in 1 to dateArray.count do
     (
        vertsPos = polyop.getVert  $  dateArray[i] ---顶点坐标。
      append vertesArray  vertsPos
        Nml_pos =   getNormal   oop  dateArray[i]  ---法线方向
      append  NamlArray  Nml_pos
     )
     /*
  subobjectLevel = 4
    oop_oo =oop .numfaces
    oop.selectedFaces = #{1..oop_oo}
   for i in 1 to oop_oo do
   (
     setFaceSmoothGroup oop  i  5  ----设置光滑组。
   )
   update  $
   subobjectLevel = 1
   */
         normal_array =NamlArray
           poly_verects_array=vertesArray

  for i in 1 to dateArray.count do ---在顶点数量中找。
     (    
      local testRay = ray poly_verects_array[i]   -normal_array[i] ----这里面加负号就是负方向处理。
      int_point= intersectRay (getNodeByName  gt_5_mode_Cloce.handNalbtn1.text )  testRay

      if int_point != undefined and  int_point != ok then
    (
     ----应该是设置的点的坐标 到新的位置上去。
     
    ray_pos_point = (int_point.pos)---int_point.pos 射线的位置
    polyop.setVert $  dateArray[i]  ray_pos_point
    )
     )--end i loop
      --max modify mode
     polyop.setVertSelection $ #()
          update $
  )
 )
 
 
 
 
)---end classof

原文地址:https://www.cnblogs.com/gaitian00/p/2060395.html