Skip to content

Commit

Permalink
Feature/optional env rotation (#17)
Browse files Browse the repository at this point in the history
* Make random rotation of environment map optional

* chore: update version to 1.3.3
  • Loading branch information
aelmiger authored May 13, 2024
1 parent 8a3ce3c commit 928127c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The following table describes each configuration parameter for the Environment P
| `environment_image` | string (dynamic evaluator capable) | The HDRI image used as the environment map, serving as both the background and the illumination source. | **Required** |
| `sun_elevation` | number (dynamic evaluator capable) | The elevation angle of the sun, defined in radians. | Required if `type` is `hdri_and_sun` |
| `sun_rotation` | number (dynamic evaluator capable) | The sun's rotation angle, measured in radians. | Required if `type` is `hdri_and_sun` |
| `random_rotation` | boolean | Randomly rotates the environment map every frame. | Optional (default: `true`) |

!!! warning
When you choose `hdri_and_sun` for the `type`, you must also provide values for `sun_elevation` and `sun_rotation`.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
requires-python = ">=3.8"
license = {text = "GPLv3"}

version = "1.2.3"
version = "1.3.3"

dynamic = ["dependencies"]

Expand Down
4 changes: 4 additions & 0 deletions syclops/blender/plugins/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def configure(self):
if self.config["type"] == "hdri_and_sun":
self._configure_hdri_and_sun()
self._load_and_set_env_texture()
if "random_rotation" in self.config:
bpy.context.scene.world.node_tree.nodes["rotation_multiplier"].inputs[
1
].default_value = (self.config["random_rotation"] * 1000)
if "strength" in self.config:
self._set_strength()
logging.info("Environment configured")
Expand Down
Binary file modified syclops/blender/plugins/plugin_data/environment.blend
Binary file not shown.
3 changes: 3 additions & 0 deletions syclops/blender/plugins/schema/environment.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ items:
sun_rotation:
description: Rotation of the sun in radians
$ref: "#/definitions/number_evaluation"
random_rotation:
description: Randomly rotate the environment map in every frame
type: boolean

if:
properties:
Expand Down

0 comments on commit 928127c

Please sign in to comment.