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