def texture(self, value): if value is None and self._texture: # print('remove texture') self._texture = None self.setTextureOff(True) return if value.__class__ is Texture: texture = value elif isinstance(value, str): texture = load_texture(value) # print('loaded texture:', texture) if texture is None: print('no texture:', value) return if texture.__class__ is MovieTexture: self._texture = texture self.model.setTexture(texture, 1) return self._texture = texture if self.model: self.model.setTexture(texture._texture, 1)
def texture(self, value): if not self.model: return if value.__class__ is Texture: texture = value elif isinstance(value, str): texture = load_texture(value) # print('loaded texture:', texture) if texture.__class__ is MovieTexture: self._texture = texture self.model.setTexture(texture) return try: self._texture = texture self.model.setTexture(texture._texture, 1) # print('set texture:', value) except: pass if value: print('no texture:', value) if value == None: self.model.set_texture_off(True)
def texture(self, value): if value is None and self._texture: # print('remove texture') self.model.clearTexture() self._texture = None return if value.__class__ is Texture: texture = value elif isinstance(value, str): texture = load_texture(value) # print('loaded texture:', texture) if texture is None: if application.raise_exception_on_missing_texture: raise ValueError(f"missing texture: '{value}'") print_warning(f"missing texture: '{value}'") return self.model.setTextureOff(False) if texture.__class__ is MovieTexture: self._texture = texture self.model.setTexture(texture, 1) return self._texture = texture if self.model: self.model.setTexture(texture._texture, 1)
def set_up(self): self.reparent_to(render) self.reflection_map = load_texture(self.reflection_map_name) self.fog = Fog('fog') self.setFog(self.fog) self.fog_color = color.light_gray self.fog_density = 0
def reflection_map(self, value): if value.__class__ is Texture: texture = value elif isinstance(value, str): texture = load_texture(value) self._reflection_map = texture
def set_up(self): from ursina.entity import Entity self.reparent_to(render) self.reflection_map = load_texture(self.reflection_map) self.fog = Fog('fog') self.setFog(self.fog) self.fog_color = color.light_gray self.fog_density = 0
def set_up(self): from ursina.entity import Entity self.reparent_to(render) self.reflection_map = load_texture(self.reflection_map)