Add Funky Blending layer support#250
Conversation
|
|
||
| if layer_props.funky_type != "FunkyDist": | ||
| # Mention that values are angles | ||
| layout.label("Values should be viewing angles in degrees between 0 and 180.", icon="RESTRICT_VIEW_OFF") |
There was a problem hiding this comment.
I think this should probably be a separate set of properties that display as angles in the UI. You could have another set of properties as your universal getters. IIRC angle float types in blender return in radians so the export math would be simpler.
| funky_ramp = self.export_funky_slot(bo, bm, hsgmat, slot, idx) | ||
| if funky_ramp: |
There was a problem hiding this comment.
Sigh, if we were on Python 3.8 this would be a good place to use the walrus...
dpogue
left a comment
There was a problem hiding this comment.
I've rebased this, and I think I've addressed the remaining feedback
Hoikas
left a comment
There was a problem hiding this comment.
I haven't actually written this down anywhere, but I'm starting to adopt a pattern with if statements in Korman where if there is ever an elif, then there must be an else:. Even if it winds up being:
else:
passjust so it's clear what the logic is. Could you go through your @propertys and make sure there is always an else: if there is an elif?
| elif funky_type == "FunkyReflect": | ||
| ramp_layer.UVWSrc = plLayerInterface.kUVWReflect |
There was a problem hiding this comment.
| elif funky_type == "FunkyReflect": | |
| ramp_layer.UVWSrc = plLayerInterface.kUVWReflect | |
| elif funky_type == "FunkyReflect": | |
| ramp_layer.UVWSrc = plLayerInterface.kUVWReflect | |
| else: | |
| raise ValueError(funky_type) |
| if near_trans > far_trans: | ||
| near_trans, far_trans = far_trans, near_trans | ||
| near_opaq, far_opaq = far_opaq, near_opaq |
There was a problem hiding this comment.
It looks like it's excepted that far_opaq could be less than near_opaq and not trigger this swap based on the additive calculation?
There was a problem hiding this comment.
This matches the implementation in PlasmaMax, but I copied over the comment: https://github.com/H-uru/Plasma/blob/58c833de3987fada154d914db769838ac92a6478/Sources/MaxPlugin/MaxConvert/hsMaterialConverter.cpp#L2962-L2967
| texture, slot = context.texture, getattr(context, "texture_slot", None) | ||
| use_stencil = slot.use_stencil if slot is not None else False |
There was a problem hiding this comment.
| texture, slot = context.texture, getattr(context, "texture_slot", None) | |
| use_stencil = slot.use_stencil if slot is not None else False | |
| texture = context.texture |
You don't seem to be using the texture slot or the stencilling info?
|
This is starting to look good. Before I merge, a couple of last questions.
|
To Do