-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from .. import LuxCoreNodeMaterial | ||
from ...utils import node as utils_node | ||
|
||
|
||
class LuxCoreNodeMatFrontBackOpacity(LuxCoreNodeMaterial): | ||
""" | ||
Not a standalone material, but a node that offers | ||
optional extra properties for all materials, to | ||
avoid cluttering all other material nodes. | ||
""" | ||
bl_label = "Front/Back Opacity" | ||
bl_width_default = 160 | ||
|
||
def init(self, context): | ||
self.add_input("LuxCoreSocketMaterial", "Material") | ||
self.add_input("LuxCoreSocketFloat0to1", "Front Opacity", 1) | ||
self.add_input("LuxCoreSocketFloat0to1", "Back Opacity", 1) | ||
|
||
self.outputs.new("LuxCoreSocketMaterial", "Material") | ||
|
||
def sub_export(self, exporter, props, luxcore_name=None, output_socket=None): | ||
input_mat_name = utils_node.export_material_input(self.inputs["Material"], exporter, props, luxcore_name) | ||
definitions = { | ||
"transparency.front": self.inputs["Front Opacity"].export(exporter, props), | ||
"transparency.back": self.inputs["Back Opacity"].export(exporter, props), | ||
} | ||
return self.create_props(props, definitions, input_mat_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters