분류 전체보기
- 드래곤큐브 - DragonCube(2015) 2019.10.11
- pos2zero 2019.10.11
- Random_Scatter_Surface 2019.10.11
- TRI,VERTEX Viewport Count 2019.10.11
드래곤큐브 - DragonCube(2015)
2019. 10. 11. 17:21
pos2zero
2019. 10. 11. 17:14
반응형
오브젝트의 x,y 볼륨의 중심이 0,0으로 가고 높이는 최하위 버텍스 기준으로 0으로 이동.
global exportsetup
rollout chReset "chRest" width:340 height:200
(
button bt_Pick "1. Pick" pos:[10,20] width:120 height:30
GroupBox group1 "result" pos:[50,90] width:150 height:70
label showbox "대기" pos:[60,120] width:100 height:30
button bt_chReset "2. chReset" pos:[10,50] width:120 height:30
on bt_Pick pressed do
(
p=pickobject prompt: "Pick Mesh"
if p!=undefined then
(
select p
p.wirecolor= [255,20,30,1]
chReset.showbox.text= "선택했습니다"
)
else
(
chReset.showbox.text= " 선택하세요"
)
)
on bt_chReset pressed do
(
mPlane=Plane length:1 width:1 name:"AlignTarget" pos:[0,0,0]
---오브젝트가 2개 이상일때 오류남
select $
deselect mPlane
SelObj=$ --선택된 오브젝트를 Selobj라 명명
CenterPivot(SelObj) --피봇을 선택된 오브젝트의 중심으로 설정
vpos = for i in SelObj.verts collect i.pos.z
--버택수를 배열로 넣어서 그중에서 최대 최소 포지션 값을 구함
vmax= amax vPos
vmin= amin vPos
move SelObj [-$.center.x,-$.center.y,- vmin]
--오브젝트를 0,0,0 에서 벗어난 만큼 빼줘서 0,0,0위치로 오게끔 설정
SelObj.Pivot=[0,0,0] --오브젝트의 피봇 위치를 설정
ResetXForm SelObj
maxOps.CollapseNode $ off ---CollapseAll
delete mPlane
chReset.showbox.text= " 이동했습니다"
)
)
createDialog chReset
반응형
'Script > MaxScript' 카테고리의 다른 글
Pos2VertexColor for Foliage Animation wip (0) | 2020.06.19 |
---|---|
FBX EXPORTER & Anim for Unity (0) | 2020.05.07 |
Random_Scatter_Surface (0) | 2019.10.11 |
TRI,VERTEX Viewport Count (0) | 2019.10.11 |
Random_Scatter_Surface
2019. 10. 11. 17:13
반응형
Random_Scatter_Surface.ms
다운로드
수정후 - 이미 생성된 곳의 폴리곤을 지워서 한번 생성된 자리에서는 다시 생성안되게~
수정전 - 무조건 랜덤생성
mBase = copy $ --선택된 바닥을 카피
mBase.wirecolor = color 88 88 255
delete $
select mBase
FaceNum = polyop.getNumFaces mBase --선택된 오브제의 총 면수
Farray = for obj in mBase.Faces collect obj.index --선택된 오브제의 면을 수집해서 Farray에 배열로 넣음
PercentCount = FaceNum*0.1 -- 폴리 선택 (현재는 전체폴리의 10%값)
GetNum=#() --배열 설정.q
for j=1 to PercentCount do --PercentCount 번동안 Farray의 배열중에 랜덤 반복선택해서 GetNum에 넣음.
(
GetNum[j] = Farray [random 1 FaceNum]
)
GetNum
-- subobjectLevel = 4
polyop.setFaceSelection mBase GetNum
for t=1 to PercentCount do --선택된 폴리만큼 오브젝트 복사.이동
(
m = copy $source
m.pos= polyop.getsafefacecenter $ GetNum[t]
m.dir = polyop.getFaceNormal $ GetNum[t]
m.wirecolor= orange
)
polyop.deleteFaces mBase GetNum --선택된 폴리를 지움.
반응형
'Script > MaxScript' 카테고리의 다른 글
Pos2VertexColor for Foliage Animation wip (0) | 2020.06.19 |
---|---|
FBX EXPORTER & Anim for Unity (0) | 2020.05.07 |
pos2zero (0) | 2019.10.11 |
TRI,VERTEX Viewport Count (0) | 2019.10.11 |
TRI,VERTEX Viewport Count
2019. 10. 11. 17:13
반응형
Global GW_displayText
unregisterRedrawViewsCallback GW_displayText
fn GW_displayText=
(
obj = selection --¿ÀºêÁ§Æ® ¼±ÅÃ
if obj!=0 then
(
for i=1 to obj.count do -- ¿ÀºêÁ§Æ®¼±ÅÃÇÑ ¼ö ¸¹Å ¹Ýº¹
(
tricount=(getTrimeshFaceCount obj[i])[1]
vertcount=(getTrimeshFaceCount obj[i])[2]
objname=obj[i].name
wPos=gw.getWinsizeX()/2
gw.wtext[wPos-100,50,0] "TRICOUNT" color:red
gw.wtext[wPos,50*i,0] objname[i] color:red
gw.wtext[wPos+100,50*i,0](tricount as string+" TRI") color:red
gw.wtext[wPos+100,50*i+20,0](vertcount as string+" VERTEX") color:red
)
)
)
registerRedrawViewsCallback GW_displayText
-- a= getTrimeshFaceCount $
-- a[1]
-- a[2]
반응형
'Script > MaxScript' 카테고리의 다른 글
Pos2VertexColor for Foliage Animation wip (0) | 2020.06.19 |
---|---|
FBX EXPORTER & Anim for Unity (0) | 2020.05.07 |
pos2zero (0) | 2019.10.11 |
Random_Scatter_Surface (0) | 2019.10.11 |