dynamic texture loading
14 November 2014 12:41
Hello,
I´m playing around with your great framework and now search a way to change the texture of an object (plane) dynamicaly after export just in javascript.. Is there aa way to use images that where not introduced to blender as a texture? let´s say a just take images from a local folder or from a remote server and change the texture on the plane evey minute?
I can access the exported objects texture filename and path like so:
but if I try to set them, nothing changes.
Is there an Api call I missed, or do you have any other idea how to handle this?
many thanks in advance,
b0
I´m playing around with your great framework and now search a way to change the texture of an object (plane) dynamicaly after export just in javascript.. Is there aa way to use images that where not introduced to blender as a texture? let´s say a just take images from a local folder or from a remote server and change the texture on the plane evey minute?
I can access the exported objects texture filename and path like so:
var obj = m_scenes.pick_object(x, y);
var texture_filenam = obj.data.materials[0].texture_slots[0].texture.image.name
var texture_filepath = obj.data.materials[0].texture_slots[0].texture.image.filepath
but if I try to set them, nothing changes.
Is there an Api call I missed, or do you have any other idea how to handle this?
many thanks in advance,
b0
14 November 2014 14:55
Hi b0,
For now the only possibility to use texture from outside exported scene is to dynamically load another exported json (for example material library) and inherit material from some object.
It's not really comfortable way so in 14.11 we'll introduce canvas textures which will perfectly suit your needs. They are used for dynamic images/videos/GIFs upload. It will be possible to even type some text on top of them from API.
So it's better to wait till the end of this month I think.
For now the only possibility to use texture from outside exported scene is to dynamically load another exported json (for example material library) and inherit material from some object.
It's not really comfortable way so in 14.11 we'll introduce canvas textures which will perfectly suit your needs. They are used for dynamic images/videos/GIFs upload. It will be possible to even type some text on top of them from API.
So it's better to wait till the end of this month I think.
14 November 2014 17:33
14 November 2014 19:48
15 November 2014 00:55
17 November 2014 18:52
18 November 2014 05:03
Damn! That´s absolutely amazing! That´s exactly what I needed.
It took me a while to realize that you even added a new example that explains everything perfectly,
(called "canvas_texture" for everybody else looking into this)
but this way I learnd a bit more about your code structure.
Thank you very much for this quick response.
I´m a big fan of yours :)
Cheers b0
It took me a while to realize that you even added a new example that explains everything perfectly,
(called "canvas_texture" for everybody else looking into this)
but this way I learnd a bit more about your code structure.
Thank you very much for this quick response.
I´m a big fan of yours :)
Cheers b0
18 November 2014 08:41
18 September 2015 19:21
21 September 2015 10:23
Hello,
You can use canvas textures in node materials as well. It will look similarly to what we have in this code snippet.
You can use canvas textures in node materials as well. It will look similarly to what we have in this code snippet.