mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
- Fix reset value not working with palette data.
This commit is contained in:
parent
9881f33b1c
commit
58ef98f8a8
11 changed files with 79 additions and 65 deletions
|
@ -120,8 +120,8 @@
|
|||
{"name":"atlas","order":22,"path":"folders/nodes/icons/value/atlas.yy",},
|
||||
{"name":"bool","order":23,"path":"folders/nodes/icons/value/bool.yy",},
|
||||
{"name":"color","order":24,"path":"folders/nodes/icons/value/color.yy",},
|
||||
{"name":"number","order":26,"path":"folders/nodes/icons/value/number.yy",},
|
||||
{"name":"mesh","order":25,"path":"folders/nodes/icons/value/mesh.yy",},
|
||||
{"name":"number","order":26,"path":"folders/nodes/icons/value/number.yy",},
|
||||
{"name":"VFX","order":15,"path":"folders/nodes/icons/VFX.yy",},
|
||||
{"name":"video_banner","order":11,"path":"folders/panels/_others/video_banner.yy",},
|
||||
{"name":"components","order":3,"path":"folders/panels/inspectors/components.yy",},
|
||||
|
|
|
@ -229,8 +229,8 @@
|
|||
{"$GMFolder":"","%Name":"atlas","folderPath":"folders/nodes/icons/value/atlas.yy","name":"atlas","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"bool","folderPath":"folders/nodes/icons/value/bool.yy","name":"bool","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"color","folderPath":"folders/nodes/icons/value/color.yy","name":"color","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"number","folderPath":"folders/nodes/icons/value/number.yy","name":"number","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"mesh","folderPath":"folders/nodes/icons/value/mesh.yy","name":"mesh","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"number","folderPath":"folders/nodes/icons/value/number.yy","name":"number","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"VFX","folderPath":"folders/nodes/icons/VFX.yy","name":"VFX","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"panels","folderPath":"folders/panels.yy","name":"panels","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"_others","folderPath":"folders/panels/_others.yy","name":"_others","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
#endregion
|
||||
|
||||
#region lua
|
||||
//lua_error_handler = _lua_error;
|
||||
lua_error_handler = _lua_error;
|
||||
#endregion
|
||||
|
||||
//print("===== Game Start End =====");
|
|
@ -319,6 +319,4 @@ Project.fps = " + string(PROJECT.animator.framerate) + @";
|
|||
");
|
||||
}
|
||||
|
||||
function _lua_error(msg, state) {
|
||||
noti_warning("Lua error: " + string(state));
|
||||
}
|
||||
function _lua_error(msg, state) { noti_warning($"Lua error: {msg}\n{state}"); }
|
|
@ -46,7 +46,10 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
tool_pos = new NodeTool( "Transform", THEME.tools_3d_transform, "Node_3D_Object" );
|
||||
tool_rot = new NodeTool( "Rotate", THEME.tools_3d_rotate, "Node_3D_Object" );
|
||||
tool_sca = new NodeTool( "Scale", THEME.tools_3d_scale, "Node_3D_Object" );
|
||||
tools = [ tool_pos, tool_rot, tool_sca ];
|
||||
|
||||
tool_euler = [ tool_pos, tool_sca ];
|
||||
tool_quate = [ tool_pos, tool_rot, tool_sca ];
|
||||
tools = tool_quate;
|
||||
|
||||
tool_axis_edit = new scrollBox([ "local", "global" ], function(val) { tool_attribute.context = val; });
|
||||
// tool_axis_edit.font = f_p2;
|
||||
|
@ -282,12 +285,13 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
var _rot = inputs[| index].getValue();
|
||||
var _qrot = object == noone? new BBMOD_Quaternion() : object.transform.rotation;
|
||||
var _qinv = new BBMOD_Quaternion().FromAxisAngle(new BBMOD_Vec3(1, 0, 0), 90);
|
||||
|
||||
|
||||
var _camera = params.camera;
|
||||
var _qview = new BBMOD_Quaternion().FromEuler(_camera.focus_angle_y, -_camera.focus_angle_x, 0);
|
||||
|
||||
var _axis = tool_attribute.context;
|
||||
|
||||
var _ang = inputs[| index].display_data.angle_display;
|
||||
var _global = _ang == QUARTERNION_DISPLAY.quarterion? tool_attribute.context : 1;
|
||||
|
||||
var _hover = noone;
|
||||
var _hoverDist = 10;
|
||||
var th;
|
||||
|
@ -322,10 +326,8 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
case 2 : np = new BBMOD_Vec3(lengthdir_x(size, ang), 0, lengthdir_y(size, ang)); break;
|
||||
}
|
||||
|
||||
if(_axis == 0)
|
||||
np = _qview.Rotate(_qinv.Rotate(_qrot.Rotate(np)));
|
||||
else if(_axis == 1)
|
||||
np = _qview.Rotate(_qinv.Rotate(np));
|
||||
if(_global) np = _qview.Rotate(_qinv.Rotate(np));
|
||||
else np = _qview.Rotate(_qinv.Rotate(_qrot.Rotate(np)));
|
||||
|
||||
if(j && (op.Z > 0 && np.Z > 0 || drag_axis == i)) {
|
||||
draw_line_round(cx + op.X, cy + op.Y, cx + np.X, cy + np.Y, th);
|
||||
|
@ -354,7 +356,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
case 2 : drag_rot_axis = new BBMOD_Vec3( 0, -1, 0); break;
|
||||
}
|
||||
|
||||
if(_axis == 0) drag_rot_axis = _qrot.Rotate(drag_rot_axis).Normalize();
|
||||
if(!_global) drag_rot_axis = _qrot.Rotate(drag_rot_axis).Normalize();
|
||||
}
|
||||
|
||||
var _nv = _qview.Rotate(_qinv.Rotate(drag_rot_axis));
|
||||
|
@ -367,7 +369,7 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
|
||||
var _currR = new BBMOD_Quaternion().FromAxisAngle(drag_rot_axis, _dist);
|
||||
var _val = _currR.Mul(drag_val);
|
||||
var _Nrot = _val.ToArray();
|
||||
var _Nrot = _ang == QUARTERNION_DISPLAY.quarterion? _val.ToArray() : _val.ToEuler(true);
|
||||
|
||||
if(inputs[| index].setValue(_Nrot))
|
||||
UNDO_HOLDING = true;
|
||||
|
@ -581,6 +583,11 @@ function Node_3D_Object(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constr
|
|||
} #endregion
|
||||
|
||||
static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) { #region
|
||||
var _rot = inputs[| 1].display_data.angle_display;
|
||||
tools = _rot == QUARTERNION_DISPLAY.quarterion? tool_quate : tool_euler;
|
||||
if(_rot == QUARTERNION_DISPLAY.euler && isUsingTool("Rotate"))
|
||||
PANEL_PREVIEW.tool_current = noone;
|
||||
|
||||
var object = getPreviewObjects();
|
||||
if(array_empty(object)) return;
|
||||
object = object[0];
|
||||
|
|
|
@ -112,6 +112,11 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
} #endregion
|
||||
|
||||
static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) { #region
|
||||
var _rot = inputs[| 1].display_data.angle_display;
|
||||
tools = _rot == QUARTERNION_DISPLAY.quarterion? tool_quate : tool_euler;
|
||||
if(_rot == QUARTERNION_DISPLAY.euler && isUsingTool("Rotate"))
|
||||
PANEL_PREVIEW.tool_current = noone;
|
||||
|
||||
var object = getPreviewObjects();
|
||||
if(array_empty(object)) return;
|
||||
object = object[0];
|
||||
|
@ -237,8 +242,6 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
var _qi3 = new BBMOD_Quaternion().FromAxisAngle(new BBMOD_Vec3(1, 0, 0), 90);
|
||||
#endregion
|
||||
|
||||
if(_sobj == noone || !struct_has(_sobj, "submit")) return [ noone, noone, noone ];
|
||||
|
||||
switch(_posm) { #region ++++ camera positioning ++++
|
||||
case 0 :
|
||||
camera.useFocus = false;
|
||||
|
@ -307,48 +310,50 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
#endregion
|
||||
|
||||
#region submit
|
||||
var _bgSurf = _dbg? scene.renderBackground(_dim[0], _dim[1]) : noone;
|
||||
_sobj.submitShadow(scene, _sobj);
|
||||
submitShadow();
|
||||
|
||||
deferData = scene.deferPass(_sobj, _dim[0], _dim[1], deferData);
|
||||
|
||||
var _render = outputs[| 0].getValue();
|
||||
var _normal = outputs[| 1].getValue();
|
||||
var _depth = outputs[| 2].getValue();
|
||||
var _bgSurf = _dbg? scene.renderBackground(_dim[0], _dim[1]) : noone;
|
||||
|
||||
_render = surface_verify(_render, _dim[0], _dim[1]);
|
||||
_normal = surface_verify(_normal, _dim[0], _dim[1]);
|
||||
_depth = surface_verify(_depth , _dim[0], _dim[1]);
|
||||
|
||||
surface_set_target_ext(0, _render);
|
||||
surface_set_target_ext(1, _normal);
|
||||
surface_set_target_ext(2, _depth );
|
||||
|
||||
DRAW_CLEAR
|
||||
if(_sobj) {
|
||||
_sobj.submitShadow(scene, _sobj);
|
||||
submitShadow();
|
||||
|
||||
deferData = scene.deferPass(_sobj, _dim[0], _dim[1], deferData);
|
||||
|
||||
surface_set_target_ext(0, _render);
|
||||
surface_set_target_ext(1, _normal);
|
||||
surface_set_target_ext(2, _depth );
|
||||
|
||||
gpu_set_zwriteenable(true);
|
||||
gpu_set_cullmode(_back);
|
||||
|
||||
if(_blend == 0) {
|
||||
gpu_set_ztestenable(true);
|
||||
} else {
|
||||
BLEND_ADD
|
||||
gpu_set_ztestenable(false);
|
||||
DRAW_CLEAR
|
||||
|
||||
gpu_set_zwriteenable(true);
|
||||
gpu_set_cullmode(_back);
|
||||
|
||||
if(_blend == 0) {
|
||||
gpu_set_ztestenable(true);
|
||||
} else {
|
||||
BLEND_ADD
|
||||
gpu_set_ztestenable(false);
|
||||
}
|
||||
|
||||
camera.applyCamera();
|
||||
scene.reset();
|
||||
scene.submitShader(_sobj);
|
||||
submitShader();
|
||||
|
||||
scene.apply(deferData);
|
||||
scene.submit(_sobj);
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
camera.resetCamera();
|
||||
}
|
||||
|
||||
camera.applyCamera();
|
||||
scene.reset();
|
||||
scene.submitShader(_sobj);
|
||||
submitShader();
|
||||
|
||||
scene.apply(deferData);
|
||||
scene.submit(_sobj);
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
camera.resetCamera();
|
||||
#endregion
|
||||
|
||||
#region render
|
||||
|
@ -362,10 +367,12 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
|||
surface_free(_bgSurf);
|
||||
}
|
||||
draw_surface_safe(_render, 0, 0);
|
||||
|
||||
BLEND_MULTIPLY
|
||||
draw_surface_safe(deferData.ssao);
|
||||
BLEND_NORMAL
|
||||
|
||||
if(deferData) {
|
||||
BLEND_MULTIPLY
|
||||
draw_surface_safe(deferData.ssao);
|
||||
BLEND_NORMAL
|
||||
}
|
||||
surface_reset_target();
|
||||
surface_free(_render);
|
||||
#endregion
|
||||
|
|
|
@ -72,8 +72,8 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
var _pat = _data[6];
|
||||
var _mid = _data[7];
|
||||
|
||||
inputs[| 8].setVisible(_pat == 1);
|
||||
inputs[| 9].setVisible(_pat == 1);
|
||||
inputs[| 8].setVisible(_pat == 2);
|
||||
inputs[| 9].setVisible(_pat == 2);
|
||||
inputs[| 10].setVisible(_type == 2);
|
||||
|
||||
var _rad = _data[ 8];
|
||||
|
|
|
@ -70,7 +70,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
attribute_surface_depth();
|
||||
attribute_oversample();
|
||||
|
||||
attributes.filter = array_create(9, 1);
|
||||
attributes.filter = array_create(9, 1);
|
||||
|
||||
static step = function() { #region
|
||||
var _wid = getInputData(1);
|
||||
|
@ -83,6 +83,8 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
inputs[| 1].mappableStep();
|
||||
inputs[| 4].mappableStep();
|
||||
inputs[| 8].mappableStep();
|
||||
|
||||
filter_button.index = attributes.filter;
|
||||
} #endregion
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||
|
@ -96,8 +98,6 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
var sam = struct_try_get(attributes, "oversample");
|
||||
var _crop = _data[12];
|
||||
|
||||
filter_button.index = attributes.filter;
|
||||
|
||||
surface_set_shader(_outSurf, sh_outline);
|
||||
shader_set_f("dimension", ww, hh);
|
||||
shader_set_f_map("borderSize", _data[1], _data[15], inputs[| 1]);
|
||||
|
|
|
@ -87,10 +87,10 @@ function Node_Struct(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
for(var i = input_fix_len; i < ds_list_size(inputs) - data_length; i += data_length) {
|
||||
var key = getInputData(i + 0);
|
||||
var val = inputs[| i + 1];
|
||||
var _ss = min(_s * 0.5, string_scale(key, bbox.w - 12 * _s, 9999));
|
||||
var _ss = min(_s * .4, string_scale(key, bbox.w - 12 * _s, 9999));
|
||||
|
||||
draw_set_color(value_color(val.type));
|
||||
draw_text_transformed(bbox.x0 + 6 * _s, inputs[| i + 0].y, key, _ss, _ss, 0);
|
||||
draw_text_transformed(bbox.x0 + 6 * _s, val.y, key, _ss, _ss, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -615,7 +615,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
#endregion
|
||||
|
||||
#region ---- value ----
|
||||
def_val = _value;
|
||||
def_val = variable_clone(_value);
|
||||
def_length = is_array(def_val)? array_length(def_val) : 0;
|
||||
def_depth = array_get_depth(def_val);
|
||||
unit = new nodeValueUnit(self);
|
||||
|
|
|
@ -1032,9 +1032,11 @@ function Panel_Preview() : PanelContent() constructor {
|
|||
|
||||
draw_surface_safe(d3_surface);
|
||||
|
||||
BLEND_MULTIPLY
|
||||
draw_surface_safe(d3_deferData.ssao);
|
||||
BLEND_NORMAL
|
||||
if(is_struct(d3_deferData)) {
|
||||
BLEND_MULTIPLY
|
||||
draw_surface_safe(d3_deferData.ssao);
|
||||
BLEND_NORMAL
|
||||
}
|
||||
break;
|
||||
case 1 : draw_surface_safe(d3_surface_normal); break;
|
||||
case 2 : draw_surface_safe(d3_surface_depth); break;
|
||||
|
|
Loading…
Reference in a new issue