macroScript MungeNormals category:"MicroForte"
(
a = pickObject message: "select an object as the center for normal calculations"
if a != undefined then
(
center = a.transform.row4
mySelection = #()
for i in selection do
(
mySelection += i
)
for i in mySelection do
(
select i
if i.modifiers[#edit_normals] != undefined then
(
inv = inverse( i.transform )
localcenter = center * inv
tm = snapshotasmesh i
a = i.Edit_Normals
for j = 1 to a.getnumnormals() do
(
a.setnormalexplicit j explicit:true
)
nVerts = tm.numverts
for j = 1 to nVerts do
(
position = getvert tm j
normal = normalize( (position * inv ) - localcenter )
trans = random (eulerangles -10 -10 -10) (eulerangles 10 10 10) as matrix3
normal = normal * trans
verts=#{j}
normals=#{}
a.convertVertexSelection &verts &normals
for k = 1 to normals.count do
(
if normals[k] == true do
(
a.SetNormal k &normal node:i
)
)
)
)
else
(
print "No edit normals modifier"
)
)
select mySelection
)
)
macros.run "MicroForte" "mungenormals"`
MaxScript Note
好东西:MAXScript vs MEL 我只看到了变量部分
0514 why tangent space http://developer.download.nvidia.com/CgTutorial/cg_tutorial_chapter08.html (8.2前一段) tangent -> world space So why use tangent space in the first place? Why not just declare all positions and vectors in world space? https://zhuanlan.zhihu.com/p/62348785 0615-1 powershell NativeCommandError
Feb 22, 2021[TOC] 使用 win10自带。其他系统或其他版本的安装参考官方文档。 控制台 win+s或w+r: powershell (推荐使用PowerShell ISE) ISE 集成脚本环境 win+s: powershell ise
Jun 15, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up