I want to "play" some animation in this UI space, the template_icon_view
:
I can load all the images I want, for example:
I know that the gif format is not available.
I know the files with video format (.wmv, .mp4, .avi), can not be played, right?
Then I tested with sprite-sheet, but I can't select or split in each "frame":
Then I create operator that allow me change the image, but manually:
actual = wm["my_previews"]
total =wm["my_previews"]
contar=True
while contar:
wm["my_previews"] = wm["my_previews"] +1
if wm.my_previews == "":
contar = False
else:
total +=1
wm["my_previews"] = wm["my_previews"]
if avanzar and actual <total:
wm["my_previews"] = actual +1
elif (avanzar and actual == total):
wm["my_previews"] = 0
elif avanzar==False and actual>0:
wm["my_previews"] = actual -1
elif (avanzar==False and actual==0):
wm["my_previews"] =total
But I can not do this automatically, because I can not update the template_icon_view
and all my tries crash blender.
I try with time, thread:
while Play:
wm["my_previews"] = wm["my_previews"] +1
if wm.my_previews == "":
wm["my_previews"] =0
Play = False
time.sleep(0.5)
z = threading.Thread(target=self.testplay(C, self.Play))
if self.Play:
z.start()
else:
z.stop()
I checked the Update options in different part of code and nothing works
bpy.context.view_layer.update()
dg =bpy.context.evaluated_depsgraph_get()
dg.update()
Any ideas? Maybe I'm in the wrong UI space to achieve my goal?
Actually, I was thinking of loading some blender files with the animations, but also I can't play that in the template_icon_view
.