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

Fixed several nodes issues #956

Merged
Merged
Show file tree
Hide file tree
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
56 changes: 29 additions & 27 deletions nodes/materials/carpaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ class LuxCoreNodeMatCarpaint(LuxCoreNodeMaterial, bpy.types.Node):
def update_preset(self, context):
enabled = self.preset == "manual"

self.inputs['Diffuse Color'].enabled = enabled
self.inputs['Specular Color 1'].enabled = enabled
self.inputs['Specular Color 2'].enabled = enabled
self.inputs['Specular Color 3'].enabled = enabled
self.inputs['M1'].enabled = enabled
self.inputs['M2'].enabled = enabled
self.inputs['M3'].enabled = enabled
self.inputs['R1'].enabled = enabled
self.inputs['R2'].enabled = enabled
self.inputs['R3'].enabled = enabled
sockets = ["Diffuse Color", "Specular Color 1", "Specular Color 2", "Specular Color 3",
"M1", "M2", "M3", "R1", "R2", "R3"]

for socket in sockets:
id = self.inputs.find(socket)
self.inputs[id].enabled = enabled

utils_node.force_viewport_update(self, context)

preset_items = [
Expand Down Expand Up @@ -77,24 +74,29 @@ def draw_buttons(self, context, layout):
layout.prop(self, "preset")

def sub_export(self, exporter, depsgraph, props, luxcore_name=None, output_socket=None):
definitions = {
"type": "carpaint",
"kd": self.inputs["Diffuse Color"].export(exporter, depsgraph, props),
"ka": self.inputs["Absorption Color"].export(exporter, depsgraph, props),
"ks1": self.inputs["Specular Color 1"].export(exporter, depsgraph, props),
"ks2": self.inputs["Specular Color 2"].export(exporter, depsgraph, props),
"ks3": self.inputs["Specular Color 3"].export(exporter, depsgraph, props),
"d": self.inputs["Absorption Depth (nm)"].export(exporter, depsgraph, props),
"m1": self.inputs["M1"].export(exporter, depsgraph, props),
"m2": self.inputs["M2"].export(exporter, depsgraph, props),
"m3": self.inputs["M3"].export(exporter, depsgraph, props),
"r1": self.inputs["R1"].export(exporter, depsgraph, props),
"r2": self.inputs["R2"].export(exporter, depsgraph, props),
"r3": self.inputs["R3"].export(exporter, depsgraph, props),
}

if self.preset != "manual":
definitions["preset"] = self.preset.replace("_", " ")
definitions = {
"type": "carpaint",
"preset": self.preset.replace("_", " "),
"ka": self.inputs["Absorption Color"].export(exporter, depsgraph, props),
"d": self.inputs["Absorption Depth (nm)"].export(exporter, depsgraph, props)
}
else:
definitions = {
"type": "carpaint",
"kd": self.inputs["Diffuse Color"].export(exporter, depsgraph, props),
"ka": self.inputs["Absorption Color"].export(exporter, depsgraph, props),
"ks1": self.inputs["Specular Color 1"].export(exporter, depsgraph, props),
"ks2": self.inputs["Specular Color 2"].export(exporter, depsgraph, props),
"ks3": self.inputs["Specular Color 3"].export(exporter, depsgraph, props),
"d": self.inputs["Absorption Depth (nm)"].export(exporter, depsgraph, props),
"m1": self.inputs["M1"].export(exporter, depsgraph, props),
"m2": self.inputs["M2"].export(exporter, depsgraph, props),
"m3": self.inputs["M3"].export(exporter, depsgraph, props),
"r1": self.inputs["R1"].export(exporter, depsgraph, props),
"r2": self.inputs["R2"].export(exporter, depsgraph, props),
"r3": self.inputs["R3"].export(exporter, depsgraph, props),
}

self.export_common_inputs(exporter, depsgraph, props, definitions)
return self.create_props(props, definitions, luxcore_name)
6 changes: 4 additions & 2 deletions nodes/materials/metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def change_input_type(self, context):
is_fresnel = self.input_type == "fresnel"
is_color = self.input_type == "color"

self.inputs["Fresnel"].enabled = is_fresnel
self.inputs["Color"].enabled = is_color
id = self.inputs.find("Fresnel")
self.inputs[id].enabled = is_fresnel
id = self.inputs.find("Color")
self.inputs[id].enabled = is_color

# The first time the user switches to "fresnel" mode,
# add a fresnel texture automatically
Expand Down
9 changes: 6 additions & 3 deletions nodes/materials/velvet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ class LuxCoreNodeMatVelvet(LuxCoreNodeMaterial, bpy.types.Node):
bl_width_default = 160

def update_advanced(self, context):
self.inputs["p1"].enabled = self.advanced
self.inputs["p2"].enabled = self.advanced
self.inputs["p3"].enabled = self.advanced
sockets = ["p1", "p2", "p3"]

for socket in sockets:
id = self.inputs.find(socket)
self.inputs[id].enabled = self.advanced

utils_node.force_viewport_update(self, context)

advanced: BoolProperty(name="Advanced Options", description="Advanced Velvet Parameters", default=False, update=update_advanced)
Expand Down
3 changes: 2 additions & 1 deletion nodes/textures/fresnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class LuxCoreNodeTexFresnel(LuxCoreNodeTexture, bpy.types.Node):
bl_width_default = 180

def change_input_type(self, context):
self.inputs["Reflection Color"].enabled = self.input_type == "color"
id = self.inputs.find("Reflection Color")
self.inputs[id].enabled = self.input_type == "color"
utils_node.force_viewport_update(self, context)

input_type_items = [
Expand Down
40 changes: 22 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
![Watermark](https://github.com/LuxCoreRender/BlendLuxCore/blob/master/luxcorerender-logo_orange_grey-shiny.png)

![Example](https://github.com/LuxCoreRender/BlendLuxCore/blob/master/luxcorerender_caustics_scene.jpg)
![Example Render](https://luxcorerender.org/wp-content/uploads/2019/10/dark_mode.jpg)

<sup> [LuxCoreRender.org](https://luxcorerender.org/) | [Forums](https://forums.luxcorerender.org/) | [Wiki](http://wiki.luxcorerender.org/LuxCoreRender_Wiki) </sup>

## BlendLuxCore
## BlendLuxCore Wheels

This addon integrates the LuxCore render engine into Blender. It offers advanced features like accelerated rendering of indirect light and efficient rendering of caustics.

**This is a special, experimental version of the add-on, based on LuxCore Python wheels.** It may not be suitable for production use.

### Supported Blender Versions

* Blender 4.2 is supported by [BlendLuxCore v2.9 beta1 (Windows only)](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.9beta1)
* Blender 4.2 is supported for Windows, Linux, MacOS Intel, MacOS ARM

* Blender 4.1 is supported by [BlendLuxCore v2.9 alpha1](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.9alpha1)
### Installation

* Blender 4.0 is supported by [BlendLuxCore v2.8 alpha1](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.8alpha1)
#### From latest release (recommended)

* Blender 3.6 LTS (3.6.x, not 3.6 itself) is experimentally supported by [BlendLuxCore v2.7 beta1](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.7beta1)
- Find latest release of **BlendLuxCore Wheels** (https://github.com/LuxCoreRender/BlendLuxCore/releases). Caveat: do not get confused with plain BlendLuxCore.
- From the release assets, download extension `BlendLuxCore*.zip`
- Open Blender and follow "Install from disk" procedure (https://docs.blender.org/manual/en/latest/editors/preferences/extensions.html)

* Blender 3.0 - 3.5.1 are supported by [BlendLuxCore v2.6 alpha1](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.6alpha1)
Beforehand, you may want to uninstall previous version of BlendLuxCore: look in "Get Extensions" panel.

* Blender 2.93 is supported by [BlendLuxCore v2.6](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.6)
#### From last commit

* Blender 2.83-2.92 are supported by [BlendLuxCore v2.5](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.5)
Prerequisites: you need `cmake` and `blender` installed and in your `PATH`

* Blender 2.83 is supported by [BlendLuxCore v2.4](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.4)
Build extension:
- clone this repository: `git clone https://github.com/LuxCoreRender/BlendLuxCore.git --branch for_blender_4.2_wheels`
- configure: `cmake -S BlendLuxCore -B blc-build`
- build: `cmake --build blc-build`

* Blender 2.80, 2.81 and 2.82 are supported by [BlendLuxCore v2.2](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.2) and [BlendLuxCore v2.3](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.3)

* Blender 2.79 is supported by [BlendLuxCore v2.0](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.0), [BlendLuxCore v2.1](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.1) and [BlendLuxCore v2.2](https://github.com/LuxCoreRender/BlendLuxCore/releases/tag/blendluxcore_v2.2)
The extension should be in `blc-build` subfolder

### [Installation and usage](https://wiki.luxcorerender.org/Category:BlendLuxCore)
Open Blender and follow "Install from disk" procedure (https://docs.blender.org/manual/en/latest/editors/preferences/extensions.html)

### [Gallery](https://luxcorerender.org/gallery/)
Beforehand, you may want to uninstall previous version of BlendLuxCore: see in "Get Extensions" panel.

### [Download example test scenes](https://luxcorerender.org/example-scenes/)
### [Gallery](https://luxcorerender.org/gallery/)

### [Download example test scenes](https://luxcorerender.org/example-scenes/)
Loading