How to implement for custom UV scaling and make use custom pivot pining script.


rollout test "test" width: 300 height:300
(
 button scale_Vertical_Half_Top_Left "scale_Vertical_Half_Top_Left"
 
 on scale_Vertical_Half_Top_Left pressed do
  (
   if (classof(modPanel.getCurrentObject())) != Unwrap_UVW then
   (
    messagebox "언랩모디파이어가 있어야 합니다." 
    return undefined
   )
   else
   (
    selectionSets["tempSel"] = selection
 
    sel = selection
   
    obj = #()
   
    for i in sel do
    (
     append obj i
    )
   
    for i = 1 to obj.count do
    (
     select obj[i]
     face = obj[i].modifiers[#unwrap_uvw].getSelectedFaces
     
     uvMod = selection[1].unwrap_uvw
     uvMod2 = uvMod.unwrap2
     selCen = uvMod.getSelCenter()
     TopLeftPoint = [0.0 , 1.0 , 0.0] -- Point3 ( Vector3 like ) data type. Custom Pivot vector X Y Z .
 
     obj[i].modifiers[#unwrap_uvw].unwrap2.scaleSelectedXY 1 0.5  TopLeftPoint -- Main Function.
    
     clearSelection()
      
     select selectionSets["tempSel"]
     
     for i in sel do
     (
      i.modifiers[#unwrap_uvw].unwrap.edit ()
      i.modifiers[#unwrap_uvw].setTVSubObjectMode 3
     )
     update $
    )
   )
  )-- scale Y half Top Left end
  
)

CreateDialog test
  
Game Developer Leegoon copyright all right reserved since 2010.

Comments