'TA/3Dmax 자주쓰는 코드 정리'에 해당되는 글 2건

  1. 2020.07.07 스크립트 제작중 롤아웃 에러가 발생해 아래처림 예외 처리함
  2. 2016.11.17 자주쓰는 코드 정리(작성중)

try
    (
        실행코드.....
    )
    catch
    (
     getCurrentException()
    )

'TA > 3Dmax 자주쓰는 코드 정리' 카테고리의 다른 글

자주쓰는 코드 정리(작성중)  (0) 2016.11.17
Posted by 프리랜서 디자이너

A

 

모디파이어 추가

 

modPanel.addModToSelection ( 모디파이어 이름 ()) ui:on


예)

modPanel.addModToSelection (Twist ()) ui:on

modPanel.addModToSelection (Displace ()) ui:on




모디파이어 속성 알아내기(리스너 실행)

show $.modifiers[#Displace]


결과는 아래 출력


  .axis : integer

  .bitmap : bitmap

  .blur : float

  .height : float

  .length : float

  .map : texturemap

  .width : float

  .cap : boolean

  .U_Tile : float

 .

 .

 .

 .





Editable poly 속성 링크(맥스 스크립트 레퍼런스)


http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=__files_GUID_0196A023_116F_47F8_99E9_AF3CB52F302C_htm


 

 

 

object type 대입 (리스너 테스트)

 

b = $ -- 선택은 오브젝트를 b에 대입
$Box:Box002 @ [0.000000,0.000000,0.000000]
ffd_mod = ffdBox() -- ffd4 모디파이어를 ffd_mod에 대입
FFDBox:FFD(box) 4x4x4
addmodifier b ffd_mod -- addmodifier 함수를 사용해 b에 ffd_mod를 추가함
OK
showproperties b
  .height : float
  .length : float
  .lengthsegs : integer
  .width : float
  .widthsegs : integer
  .mapcoords : boolean
  .heightsegs : integer
  .realWorldMapSize : boolean
false
showproperties ffd_mod -- 프로퍼티 확인
  .dispLattice (Lattice) : boolean
  .dispSource (Source_Volume) : boolean
  .deformType : integer
  .falloff : float
  .tension : float
  .continuity : float
  .inPoints (Inside_Points) : boolean
  .outPoints (Outside_Points) : boolean
  .offset : float
  .Lattice_Transform : transform
false

 

 

** 사실 왜 b가 아닌 ffd_mod에서 프로퍼티가 접근해야하는지 이해가 안가지만

위 절차대로 해야 모디파이어 프로퍼티에 접근 할 수 있습니다.

 


 

UI 체크박스 예제

 

checkbox 'AAA' "Smoothing Groups" pos:[12,141] width:132 height:21 checked:true align:#left

 

on AAA changed theState do
 (
  taget . smoothResult = AAA.checked
 )

 

 

 

 

 

if 문

a = 1

if a == 1 then messageBox "hello"

 

if a == 1 do messageBox "hello"

 

if a == 1 then (

 messageBox "hello1"

)

else(

 messageBox "hello2"

)

 

(ex)

if null != select do (messagebox ("Select Object!! "))

 

 

 

 Projection Pick Object


addPModObjects #($적용할 오브젝트 이름) false false objList:#($선택할 대상 오브젝트 이름)


또는


theProj.addObjectNode highpoly

 



Projection Export Cage


$.modifiers[#Projection].exportCage "생성될 오브젝트 이름"

 



이름으로 오브젝트 선택하기


select $objName

 



Editable poly 스무스 그룹


페이스 선택

subobjectLevel = 4


모든 페이스 선택

max select all


스무스 그룹 Clear All

polyop.setFaceSmoothGroup $ #all 0


스무스 그룹 넘버 선택

polyop.setFaceSmoothGroup $ #all 1


오토 스무스

$.EditablePoly.autosmooth ()



 




Assign Renderer


랜더러 선택

renderers.current = RendererClass.classes[1]()


메터리얼 잠김 풀기

renderers.medit_locked = false


메터리얼 바꾸기

renderers.medit = mental_ray_renderer()


엑티브 쉐이드 바꾸기

renderers.activeShade = iray_Renderer()






Color


local WGray = color 200 200 200

 



스켄라인 랜더러 안티얼라이싱 필터 클래스


showClass"*:filter*"


Area : filter {77912301,0}

Quadratic : filter {77912304,0}

cubic : filter {77912305,0}

Catmull_Rom : filter {77912306,0}

Blackman : filter {77912313,0}

Sharp_Quadratic : filter {77912314,0}

Video : filter {77912319,0}

Plate_Match_MAX_R2 : filter {7791231b,0}

Cook_Variable : filter {77912330,0}

Soften : filter {77912331,0}

Mitchell_Netravali : filter {77912350,0}

Blendfilter : filter {77912352,0}

Filter_kernel_plug_in_not_found : filter {ffffffff,0}

OK


 


사용 예시

renderers.production.antiAliasFilter =Mitchell_Netravali()






스켄라인 랜더러 다이얼로그 클래스


show renderers.production


  .mapping : boolean

  .shadows : boolean

  .autoReflect : boolean

  .forceWireframe : boolean

  .antiAliasing : boolean

  .filterMaps : boolean

  .objectMotionBlur : boolean

  .imageMotionBlur : boolean

  .imageBlurEnv : boolean

  .imageBlurTrans : boolean

  .conserveMemory : boolean

  .enablePixelSampler : boolean

  .enableSSE : boolean

  .wireThickness : float

  .objectBlurDuration : float

  .imageBlurDuration : float

  .antiAliasFilterSize : float

  .objectBlurSamples : integer

  .objectBlurSubdivisions : integer

  .autoReflectLevels : integer

  .colorClampType : integer

  .antiAliasFilter : maxObject

  .globalSamplerEnabled : boolean

  .globalSamplerClassByName : TSTR by value

  .globalSamplerSampleMaps : boolean

  .globalSamplerQuality : float

  .globalSamplerAdaptive : boolean

  .globalSamplerAdaptiveThresh : float

false

 




드롭다운 UI 사용법(string)


local formatSel 


on Format_Texture selected sel do

(

formatSel =  Format_Texture.selected 

)

 



 

 엠비언트 오클루전 베이크 프로퍼티


be = Ambient_Occlusion()


show be

  .enabled : boolean

  .filterOn (FilteringOn) : boolean

  .outputSzX (output_width) : integer

  .outputSzY (output_height) : integer

  .autoSzOn (Auto_Size_On) : boolean

  .fileName : filename

  .filenameUnique (Filename_Unique) : boolean

  .fileType : filename

  .elementName : string

  .bitmap : bitmap

  .backgroundColor (Background_Color) : fRGBA color

  .targetMapSlotName : string

  .samples : integer

  .bright : fRGBA color

  .dark : fRGBA color

  .spread : float

  .maxDistance (Max_Dist) : float

  .falloff : float

false

 


 

 다이얼로그 켜고 끄기


해당 매크로 스크립트를 열고 명령어를 찾아보면 됨

macros.run "Render" "BakeDialog"

destroydialog gTextureBakeDialog


 


 

 


 

Posted by 프리랜서 디자이너