mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Compare commits
4 commits
bace34795a
...
824d73b8db
Author | SHA1 | Date | |
---|---|---|---|
824d73b8db | |||
033238b787 | |||
d4c3ae3dc6 | |||
b4fbb1df75 |
|
@ -236,8 +236,8 @@ func display_effects(cel: BaseCel, image_override: Image = null) -> Image:
|
||||||
continue
|
continue
|
||||||
var params := effect.params
|
var params := effect.params
|
||||||
params["PXO_time"] = cel.get_frame(project).position_in_seconds(project)
|
params["PXO_time"] = cel.get_frame(project).position_in_seconds(project)
|
||||||
params["PXO_frame"] = project.frames.find(cel.get_frame(project))
|
params["PXO_frame_index"] = project.frames.find(cel.get_frame(project))
|
||||||
params["PXO_layer"] = index
|
params["PXO_layer_index"] = index
|
||||||
var shader_image_effect := ShaderImageEffect.new()
|
var shader_image_effect := ShaderImageEffect.new()
|
||||||
shader_image_effect.generate_image(image, effect.shader, params, image_size)
|
shader_image_effect.generate_image(image, effect.shader, params, image_size)
|
||||||
# Inherit effects from the parents, if their blend mode is set to pass through
|
# Inherit effects from the parents, if their blend mode is set to pass through
|
||||||
|
|
|
@ -63,7 +63,7 @@ static func create_ui_for_shader_uniforms(
|
||||||
var u_init := u_left_side[0].split(" ")
|
var u_init := u_left_side[0].split(" ")
|
||||||
var u_type := u_init[1]
|
var u_type := u_init[1]
|
||||||
var u_name := u_init[2]
|
var u_name := u_init[2]
|
||||||
if u_name in ["PXO_time", "PXO_frame", "PXO_layer"]:
|
if u_name in ["PXO_time", "PXO_frame_index", "PXO_layer_index"]:
|
||||||
continue
|
continue
|
||||||
# Find custom data of the uniform, if any exists
|
# Find custom data of the uniform, if any exists
|
||||||
# Right now it only checks if a uniform should have another type of node
|
# Right now it only checks if a uniform should have another type of node
|
||||||
|
|
|
@ -83,7 +83,9 @@ func _set_node_values() -> void:
|
||||||
elif node is CheckBox:
|
elif node is CheckBox:
|
||||||
node.button_pressed = value
|
node.button_pressed = value
|
||||||
elif node is GradientEditNode:
|
elif node is GradientEditNode:
|
||||||
node.gradient = value
|
var gradient_tex := GradientTexture2D.new()
|
||||||
|
gradient_tex.gradient = value
|
||||||
|
node.set_gradient_texture(gradient_tex)
|
||||||
|
|
||||||
|
|
||||||
func _set_value_from_node(value, prop: String) -> void:
|
func _set_value_from_node(value, prop: String) -> void:
|
||||||
|
|
|
@ -166,6 +166,7 @@ func _gui_input(event: InputEvent) -> void:
|
||||||
else:
|
else:
|
||||||
if event.ctrl_pressed:
|
if event.ctrl_pressed:
|
||||||
value = roundf(value / snap_step) * snap_step
|
value = roundf(value / snap_step) * snap_step
|
||||||
|
get_viewport().set_input_as_handled()
|
||||||
|
|
||||||
|
|
||||||
func _setup_nodes() -> void: ## Only called once on _ready()
|
func _setup_nodes() -> void: ## Only called once on _ready()
|
||||||
|
|
|
@ -180,8 +180,8 @@ func _apply_effect(layer: BaseLayer, effect: LayerEffect) -> void:
|
||||||
var image_size := cel_image.get_size()
|
var image_size := cel_image.get_size()
|
||||||
var params := effect.params
|
var params := effect.params
|
||||||
params["PXO_time"] = frame.position_in_seconds(project)
|
params["PXO_time"] = frame.position_in_seconds(project)
|
||||||
params["PXO_frame"] = i
|
params["PXO_frame_index"] = i
|
||||||
params["PXO_layer"] = layer.index
|
params["PXO_layer_index"] = layer.index
|
||||||
var shader_image_effect := ShaderImageEffect.new()
|
var shader_image_effect := ShaderImageEffect.new()
|
||||||
shader_image_effect.generate_image(cel_image, effect.shader, params, image_size)
|
shader_image_effect.generate_image(cel_image, effect.shader, params, image_size)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue