Esempio n. 1
0
 def export_texture_effect(self, b_texture_node=None):
     """Export a texture effect block from material texture mtex (MTex, not Texture)."""
     texeff = NifFormat.NiTextureEffect()
     texeff.flags = 4
     texeff.rotation.set_identity()
     texeff.scale = 1.0
     texeff.model_projection_matrix.set_identity()
     texeff.texture_filtering = NifFormat.TexFilterMode.FILTER_TRILERP
     texeff.texture_clamping = NifFormat.TexClampMode.WRAP_S_WRAP_T
     texeff.texture_type = NifFormat.EffectType.EFFECT_ENVIRONMENT_MAP
     texeff.coordinate_generation_type = NifFormat.CoordGenType.CG_SPHERE_MAP
     if b_texture_node:
         texeff.source_texture = TextureWriter.export_source_texture(b_texture_node.texture)
         if bpy.context.scene.niftools_scene.game == 'MORROWIND':
             texeff.num_affected_node_list_pointers += 1
             texeff.affected_node_list_pointers.update_size()
     texeff.unknown_vector.x = 1.0
     return block_store.register_block(texeff)
Esempio n. 2
0
 def export_texture_effect(self, b_mat_texslot=None):
     """Export a texture effect block from material texture mtex (MTex, not
     Texture)."""
     texeff = NifFormat.NiTextureEffect()
     texeff.flags = 4
     texeff.rotation.set_identity()
     texeff.scale = 1.0
     texeff.model_projection_matrix.set_identity()
     texeff.texture_filtering = NifFormat.TexFilterMode.TRILINEAR
     texeff.texture_clamping = NifFormat.TexClampMode.WRAP_S_WRAP_T
     texeff.texture_type = NifFormat.EffectType.ENVIRONMENT_MAP
     texeff.coordinate_generation_type = NifFormat.CoordGenType.SPHERE_MAP
     if b_mat_texslot:
         texeff.source_texture = self.texture_writer.export_source_texture(
             b_mat_texslot.texture)
         if self.properties.game == 'MORROWIND':
             texeff.num_affected_node_list_pointers += 1
             texeff.affected_node_list_pointers.update_size()
     texeff.unknown_vector.x = 1.0
     return self.register_block(texeff)