Как создать анимированный материал для частиц из такой многокадровой текстуры? Нужно чтобы в каждом следующем фрейме, отображался следующий рисунок текстуры.
Пример. В новой сцене запускаем скрипт. Открывается новое окно.
Нажимаем кнопку Select Image и выбираем файл многокадровой текстуры.
try destroydialog test catch()
rollout test "test"
(
spinner spn_count "Count:" range:[1,10000,4] type:#integer
button btn_select_image "Select Image"
on btn_select_image pressed do
(
f = getOpenFileName caption:"Select Image" types:"PNG (*.png)|*.png|All|*.*|"
if f!=undefined then
(
bm=openBitMap f
if bm!=undefined then
(
n=spn_count.value
bmt=bitmaptexture bitmap:bm
bmt.apply =true; bmt.cropPlace=0;
bmt.clipw=1.0/n; bmt.cliph=1.0/n
bmt.clipu.controller=Bezier_Float()
bmt.clipv.controller=Bezier_Float()
for i=1 to n do
(
for j=1 to n do
(
c=bmt.clipu.controller
k=addnewkey c ((j-1)*n+i)
k.inTangentType=#step;k.outTangentType=#step;
k.value=1.0*(i-1)/n
c=bmt.clipv.controller
k=addnewkey c ((j-1)*n+i)
k.inTangentType=#step;k.outTangentType=#step;
k.value=1.0*(j-1)/n
)--for j=1 to spn_count.value do
)--for i=1 to spn_count.value do
sm=standardmaterial(); sm.diffuseMap=bmt; sm.showInViewport=true
p=plane(); p.width=bm.width; p.length=bm.height;
p.pos=[0,0,0];p.material=sm
select p; max zoomext sel; completeredraw()
)--if bm!=undefined then
)--if f!=undefined then
)--on btn_select_image pressed do
); createdialog test 100 55
Чтобы запустить скрипт нужно:
1. Создаем текстовый файл (NotePad) и копируем код (текст) скрипта.
2. Сохраняем текстовый файл с названием "test.ms"
3. В главное меню MaxScript выбираем пункт Run Script. Выбираем файл "test.ms"
Доступ к резюме доступен только по пакетному доступу HR менеджерам зарегистрированных компаний. Узнать о вариантах корпоративных пакетов можно по ссылке.
jonconnor
Вложения
igorznag
Нажимаем кнопку Select Image и выбираем файл многокадровой текстуры.
try destroydialog test catch() rollout test "test" ( spinner spn_count "Count:" range:[1,10000,4] type:#integer button btn_select_image "Select Image" on btn_select_image pressed do ( f = getOpenFileName caption:"Select Image" types:"PNG (*.png)|*.png|All|*.*|" if f!=undefined then ( bm=openBitMap f if bm!=undefined then ( n=spn_count.value bmt=bitmaptexture bitmap:bm bmt.apply =true; bmt.cropPlace=0; bmt.clipw=1.0/n; bmt.cliph=1.0/n bmt.clipu.controller=Bezier_Float() bmt.clipv.controller=Bezier_Float() for i=1 to n do ( for j=1 to n do ( c=bmt.clipu.controller k=addnewkey c ((j-1)*n+i) k.inTangentType=#step;k.outTangentType=#step; k.value=1.0*(i-1)/n c=bmt.clipv.controller k=addnewkey c ((j-1)*n+i) k.inTangentType=#step;k.outTangentType=#step; k.value=1.0*(j-1)/n )--for j=1 to spn_count.value do )--for i=1 to spn_count.value do sm=standardmaterial(); sm.diffuseMap=bmt; sm.showInViewport=true p=plane(); p.width=bm.width; p.length=bm.height; p.pos=[0,0,0];p.material=sm select p; max zoomext sel; completeredraw() )--if bm!=undefined then )--if f!=undefined then )--on btn_select_image pressed do ); createdialog test 100 55Чтобы запустить скрипт нужно:1. Создаем текстовый файл (NotePad) и копируем код (текст) скрипта.
2. Сохраняем текстовый файл с названием "test.ms"
3. В главное меню MaxScript выбираем пункт Run Script. Выбираем файл "test.ms"
вадим соболев (maiden666)