node_shader_utils: fix bad setting of use_nodes in readonly case.

Also added access to extension property in texture wrapper.
This commit is contained in:
Bastien Montagne 2018-10-16 16:32:43 +02:00
parent f250f9256e
commit fb550ca6b9
1 changed files with 12 additions and 1 deletions

View File

@ -94,7 +94,8 @@ class ShaderWrapper():
def __init__(self, material, is_readonly=True, use_nodes=True):
self.is_readonly = is_readonly
self.material = material
self.use_nodes = use_nodes
if not is_readonly:
self.use_nodes = use_nodes
self.update()
def update(self): # Should be re-implemented by children classes...
@ -653,6 +654,16 @@ class ShaderImageTextureWrapper():
texcoords = property(texcoords_get, texcoords_set)
def extension_get(self):
return self.node_image.extension if self.node_image is not None else 'REPEAT'
@_set_check
def extension_set(self, extension):
self.node_image.extension = extension
extension = property(extension_get, extension_set)
# --------------------------------------------------------------------
# Mapping.