[Closed] Image sequence viewer with timeline
I found this code and I would like to use it in conjunction with the timeline that when moving the timeline also moves the slider in conjunction with the timeline.
It works very well like this one, but if you could add that the viewer updates the images according to the time of the timeline would be something extraordinary!
#1 “I’m not a programmer and I don’t have any scripting skills. Please help me with this kind of script which will be very helpful in my workflow and for all 3d animators ”
(
try(cui.UnRegisterDialogBar rlt_preview) catch()
try(destroyDialog rlt_preview) catch()
global Thepos1=[0,0]
global mousedd1=false
local allFiles1 = #()
local shu=0
local last_path = “”
local bofang=true
local shijian=0
local shudu=1
rollout rlt_preview “viewer” width:492 height:370
(
bitmap img_preview "texture preview" pos:[6,6] bitmap:(bitmap 480 270 color:black)
slider sld1 "0000" pos:[6,280] width:335 height:44 range:[1,100,1] type:#integer ticks:0 border:false
button btn1 "Play" pos:[140,328] width:78 height:25
button btn2 ">>" pos:[224,328] width:25 height:25
button btn3 "<<" pos:[110,328] width:23 height:25
button btn4 "Load" pos:[21,328] width:39 height:24
button btn5 "x" pos:[70,328] width:25 height:25 toolTip:"exit"
Timer clock "testClock" pos:[310,325] width:24 height:24 interval:1
Timer clock1 "testClock" pos:[310,325] width:24 height:24 interval:1000
slider sld14 "" pos:[263,340] width:79 height:25 range:[1,40,1] type:#integer ticks:0 border:false
label lbl3 "Speed" pos:[275,322] width:52 height:18
on rlt_preview lbuttondblclk g11 do
(
DestroyDialog rlt_preview
)
on rlt_preview lbuttonup pos1 do
mousedd1=false
on rlt_preview lbuttondown pos1 do
(
mousedd1=true
Thepos1=pos1
)
on rlt_preview mousemove pos1 do
( if mousedd1==true Then
(SetDialogPos rlt_preview (mouse.screenpos-Thepos1))
)
on rlt_preview open do
(
)
on btn5 pressed do
(
destroydialog rlt_preview
)
on sld1 changed val do
(
if last_path!="" do
(
shu=val
rlt_preview.img_preview.bitmap = openBitMap allFiles1[val]
)
)
on sld4 changed val do
(
shijian=val
)
on btn1 pressed do
(
if last_path!="" do
(
if bofang==true then (bofang=false )else(bofang=true )
if bofang==true then (btn1.text="Play" )else(btn1.text="Stop" )
)
)
on btn2 pressed do
(
if last_path!="" do
(
if shu<allFiles1.count then
(
shu=shu+1
)
else
(
shu=shu-allFiles1.count+1
)
sld1.range=[1,allFiles1.count,shu]
rlt_preview.img_preview.bitmap = openBitMap allFiles1[shu]
)
)
on btn3 pressed do
(
if last_path!="" do
(
if shu >1 then ( shu=shu-1)
else (shu=allFiles1.count)
sld1.range=[1,allFiles1.count,shu]
rlt_preview.img_preview.bitmap = openBitMap allFiles1[shu]
)
)
on btn4 pressed do
(
local path = getSavePath caption:"" initialDir:last_path
if path == undefined then
(
path = ""
)
else(
last_path = path
DestinationPath_STR = path as string
get_path = DestinationPath_STR + "\\"
allFiles1 = getFiles (get_path+"*.png")
allFiles1 =allFiles1+ getFiles (get_path+"*.jpg")
rlt_preview.img_preview.bitmap = openBitMap allFiles1[1]
sld1.text= allFiles1.count as string
sld1.range=[1,allFiles1.count,1]
)
)
on clock1 tick do
(
lbl3.text="Speed"
)
on clock tick do
(
sld1.text=shu as string
shijian=shijian+1
if shijian==shudu do
(
shijian=0
if bofang ==false do ( if shu<allFiles1.count then (
shu=shu+1
)else(shu=shu-allFiles1.count+1)
sld1.range=[1,allFiles1.count,shu]
rlt_preview.img_preview.bitmap = openBitMap allFiles1[shu] )
)
)
on sld14 changed val do
(shudu=val
shijian=0
)
)
createdialog rlt_preview style:#( #style_minimizebox)
)
For the 3D animator having a quick feedback is essential when animating, here is an example of what I have achieved so far. Now I can slide the slider and the timeline responds, but I can’t make it work the other way around.
Ok. Now I get it.
If you are interested I can provide a workaround without using script.
I used to use bitmap sequence as texture.
That is:
Create an image sequence from your video.(smaller the image dimension the better)
Create a .waw file from from the audio.
Load your image sequence into a “bitmap” texture, as sequence.
Display your bitmap texture (from a material) in a plane in your scene