-
Notifications
You must be signed in to change notification settings - Fork 17
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
Double Sided per Material #280
base: master
Are you sure you want to change the base?
Conversation
korman/operators/op_toolbox.py
Outdated
@@ -174,33 +174,33 @@ def execute(self, context): | |||
|
|||
|
|||
class PlasmaToggleDoubleSidedOperator(ToolboxOperator, bpy.types.Operator): | |||
bl_idname = "mesh.plasma_toggle_double_sided" | |||
bl_idname = "mat.plasma_toggle_double_sided" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blender uses bpy.ops.material
for material operators instead of bpy.ops.mat
.
korman/operators/op_toolbox.py
Outdated
mat_list = [i.data for i in context.selected_objects if i.type == "MATERIAL"] | ||
enable = not all((mat.plasma_mat.plasma_double_sided for mat in mat_list)) | ||
for mat in mat_list: | ||
mat.plasma_mat.plasma_double_sided = enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, MATERIAL
isn't a valid object type. It might be easier for us to chain the material slots, so something like...
mat_list = [slot.material for slot in itertools.chain.from_iterable((i.material_slots for i in context.selected_objects)) if slot and slot.material]
(Warning: untested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cope with some rename changes.
Sorry for being late to the party, but maybe this could tie into |
That sounds like a good idea, but isn't BGE gone in Blender 2.80 and above? |
One way or another, that's irrelevant for Korman, I assume. |
Blender 2.80 moved the |
Will 2.80 migrate the old BGE property into the materials for us? I'd like to future proof this as much as possible now so that there are no surprises an unknown amount of time in the future. |
Unfortunately it's not migrated. Good catch. ...With that said, Blender 2.80 wipes clean materials from 2.79 anyway (save for custom props). So upgrading older files will require a custom operator/utility to convert existing materials to the equivalent Korman will use in 2.80. |
Start of Plasma Material Panel additions
Adjusts the Toolbox Double Sided Button Operators to use new material panel toggle for double sided.
More adjustments to get the dang thing working
Added suggestions from Hoikas
Puts in suggestions from Hoikas. Co-authored-by: Adam Johnson <AdamJohnso@gmail.com>
This is my WIP solution to issue #255 . The goal is to give the Age builder the option to set double-sided by material instead of by entire objects.
To do:
lighting_mod.unleashed
.Again, this is my (admittedly clumsy) attempt to fix this issue as I believe it aligns more with how Cyan's plugin did things based on observations. It would keep extra materials from being needlessly set to TWOSIDE and possibly be a slight improvement in performance.