- Рейтинг
- 7
Доброго всем здравия, уважаемые профессионалы!
Никак не могу запустить приложенный скрипт для рендера только вершин модели.
Не нашел другого способа рендера только вершин объектов (модификатор Lattice совсем не понравился).
Посмотрите, пожалуйста, что необходимо подправить в приложенном скрипте
(описание его здесь: https://help.autodesk.com/view/3DSM...GUID_853014AC_9DC8_4F5C_B14B_3643E5925AD8_htm).
Спасибо заранее огромное.
Скрипт приложен к сообщению и расположен здесь (для удобства):
----------------------
macroScript VertexRender category:"HowTo"
(
local VertexRendererEnabled = false
local screen_width, screen_height, back_vfb, front_vfb
fn VertexRendererFunction =
(
st = timestamp()
copy back_vfb front_vfb
for o in geometry where classof o != TargetObject do
(
theMesh = snapshotAsMesh o
dot_color = #(o.wirecolor)
theVertCount = theMesh.numverts
for v = 1 to theVertCount do
(
thePos = (getVert theMesh v)* viewport.getTM()
screen_origin = mapScreenToView [0,0] (thePos.z) [screen_width,screen_height]
end_screen = mapScreenToView [screen_width,screen_height] (thePos.z) [screen_width,screen_height]
world_size = screen_origin-end_screen
x_aspect = screen_width/(abs world_size.x)
y_aspect = screen_height/(abs world_size.y)
screen_coords = point2 (x_aspect*(thePos.x-screen_origin.x)) (-(y_aspect*(thePos.y-screen_origin.y)))
setPixels front_vfb screen_coords dot_color
)--end v loop
)--end o loop
display front_vfb
et = timestamp()
pushPrompt ("VertRender "+(1000.0/(et-st)) as string +" fps")
)--end fn
on isChecked return VertexRendererEnabled
on execute do
(
VertexRendererEnabled =not VertexRendererEnabled
if VertexRendererEnabled then
(
screen_width=RenderWidth
screen_height=RenderHeight
back_vfb = bitmap screen_width screen_height
front_vfb = bitmap screen_width screen_height
registerRedrawViewsCallback VertexRendererFunction
RedrawViews()
)
else
(
unRegisterRedrawViewsCallback VertexRendererFunction
close front_vfb
)
)--end on execute
)--end script
-----------------
Никак не могу запустить приложенный скрипт для рендера только вершин модели.
Не нашел другого способа рендера только вершин объектов (модификатор Lattice совсем не понравился).
Посмотрите, пожалуйста, что необходимо подправить в приложенном скрипте
(описание его здесь: https://help.autodesk.com/view/3DSM...GUID_853014AC_9DC8_4F5C_B14B_3643E5925AD8_htm).
Спасибо заранее огромное.
Скрипт приложен к сообщению и расположен здесь (для удобства):
----------------------
macroScript VertexRender category:"HowTo"
(
local VertexRendererEnabled = false
local screen_width, screen_height, back_vfb, front_vfb
fn VertexRendererFunction =
(
st = timestamp()
copy back_vfb front_vfb
for o in geometry where classof o != TargetObject do
(
theMesh = snapshotAsMesh o
dot_color = #(o.wirecolor)
theVertCount = theMesh.numverts
for v = 1 to theVertCount do
(
thePos = (getVert theMesh v)* viewport.getTM()
screen_origin = mapScreenToView [0,0] (thePos.z) [screen_width,screen_height]
end_screen = mapScreenToView [screen_width,screen_height] (thePos.z) [screen_width,screen_height]
world_size = screen_origin-end_screen
x_aspect = screen_width/(abs world_size.x)
y_aspect = screen_height/(abs world_size.y)
screen_coords = point2 (x_aspect*(thePos.x-screen_origin.x)) (-(y_aspect*(thePos.y-screen_origin.y)))
setPixels front_vfb screen_coords dot_color
)--end v loop
)--end o loop
display front_vfb
et = timestamp()
pushPrompt ("VertRender "+(1000.0/(et-st)) as string +" fps")
)--end fn
on isChecked return VertexRendererEnabled
on execute do
(
VertexRendererEnabled =not VertexRendererEnabled
if VertexRendererEnabled then
(
screen_width=RenderWidth
screen_height=RenderHeight
back_vfb = bitmap screen_width screen_height
front_vfb = bitmap screen_width screen_height
registerRedrawViewsCallback VertexRendererFunction
RedrawViews()
)
else
(
unRegisterRedrawViewsCallback VertexRendererFunction
close front_vfb
)
)--end on execute
)--end script
-----------------
Вложения
-
1,5 КБ Просмотров: 156