Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Opacity Fader from Plasma flare function #319

Merged
merged 2 commits into from
Mar 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions korman/operators/op_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,34 +122,27 @@ def create_flare_objects(self):
# Parent Plane to Empty
flare_plane.parent = flare_root

# Enable Opacity Fader
bpy.ops.object.plasma_modifier_add(types="fademod")
flare_plane.plasma_modifiers.fademod.fader_type = "FadeOpacity"
flare_plane.plasma_modifiers.fademod.fade_in_time = 0.25
flare_plane.plasma_modifiers.fademod.fade_out_time = 0.25
flare_plane.plasma_modifiers.fademod.bounds_center = True

def find_create_material(self):
# If the selected flare material exists, use it
auto_mat = bpy.data.materials.get(self.flare_material_name, None)

if auto_mat is None:
# Generate a new flare material and texture
auto_mat = bpy.data.materials.new(name=FLARE_MATERIAL_BASE_NAME)
auto_mat.use_shadeless = True
auto_mat.emit = 1.0
auto_mat.use_shadows = False
auto_mat.use_cast_shadows = False
self.flare_material_name = auto_mat.name

auto_tex = bpy.data.textures.new(name=FLARE_MATERIAL_BASE_NAME, type="IMAGE")
auto_tex.use_alpha = True
auto_tex.plasma_layer.skip_depth_write = True
auto_tex.plasma_layer.skip_depth_test = True
auto_tex.plasma_layer.z_bias = True

new_slot = auto_mat.texture_slots.add()
new_slot.texture = auto_tex
new_slot.blend_type = "ADD"
new_slot.use_map_emit = True

return auto_mat

Expand Down