From d8c14af546351a716b3e089b2573f4b81067b4c9 Mon Sep 17 00:00:00 2001 From: Maximillian Date: Tue, 6 Jan 2015 11:46:47 -0700 Subject: Fix invaild path error text in project manager when no path is entered --- tools/editor/project_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index cf94758ad6..0af4a23547 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -65,7 +65,7 @@ class NewProjectDialog : public ConfirmationDialog { error->set_text(""); get_ok()->set_disabled(true); DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - if (d->change_dir(project_path->get_text())!=OK) { + if (project_path->get_text() != "" && d->change_dir(project_path->get_text())!=OK) { error->set_text("Invalid Path for Project, Path Must Exist!"); memdelete(d); return false; @@ -82,7 +82,7 @@ class NewProjectDialog : public ConfirmationDialog { } else { - if (!d->file_exists("engine.cfg")) { + if (project_path->get_text() != "" && !d->file_exists("engine.cfg")) { error->set_text("Invalid Project Path (engine.cfg must exist)."); memdelete(d); -- cgit v1.2.3 From cf616e584586bb875bed5a817c531918233444c2 Mon Sep 17 00:00:00 2001 From: Maximillian Date: Tue, 6 Jan 2015 15:28:25 -0700 Subject: Prompt save dialog if running a unsaved scene. Solution for #966 --- tools/editor/editor_node.cpp | 29 ++++++++++++++++++++++++----- tools/editor/editor_node.h | 2 ++ 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 5843a7cb28..7f75627a90 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -975,9 +975,19 @@ void EditorNode::_dialog_action(String p_file) { if (file->get_mode()==FileDialog::MODE_SAVE_FILE) { _save_scene(p_file); + _run(false); } } break; + + case FILE_SAVE_AND_RUN: { + if (file->get_mode()==FileDialog::MODE_SAVE_FILE) { + + _save_scene(p_file); + _run(false); + } + } break; + case FILE_EXPORT_MESH_LIBRARY: { Ref ml; @@ -1391,13 +1401,10 @@ void EditorNode::_run(bool p_current,const String& p_custom) { } if (scene->get_filename()=="") { - - current_option=-1; //accept->get_cancel()->hide(); - accept->get_ok()->set_text("I see.."); - accept->set_text("Scene has never been saved. Save before running!"); - accept->popup_centered(Size2(300,70));; + /**/ + _menu_option_confirm(FILE_SAVE_BEFORE_RUN, false); return; } @@ -1664,6 +1671,18 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; + case FILE_SAVE_BEFORE_RUN: { + if (!p_confirmed) { + accept->get_ok()->set_text("Yes"); + accept->set_text("This scene has never been saved. Save before running?"); + accept->popup_centered(Size2(300, 70)); + break; + } + + _menu_option(FILE_SAVE_AS_SCENE); + _menu_option_confirm(FILE_SAVE_AND_RUN, true); + } break; + case FILE_DUMP_STRINGS: { Node *scene = edited_scene; diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 381993646e..7560c2b149 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -108,6 +108,8 @@ class EditorNode : public Node { FILE_OPEN_SCENE, FILE_SAVE_SCENE, FILE_SAVE_AS_SCENE, + FILE_SAVE_BEFORE_RUN, + FILE_SAVE_AND_RUN, FILE_IMPORT_SUBSCENE, FILE_EXPORT_PROJECT, FILE_EXPORT_MESH_LIBRARY, -- cgit v1.2.3 From 5d86f845d7a67ec9e2c71fe975e1abcbb1a97097 Mon Sep 17 00:00:00 2001 From: Maximillian Date: Tue, 6 Jan 2015 20:35:52 -0700 Subject: fix little mistake that made the project run each save --- tools/editor/editor_node.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 7f75627a90..52c75c6d7e 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -975,7 +975,6 @@ void EditorNode::_dialog_action(String p_file) { if (file->get_mode()==FileDialog::MODE_SAVE_FILE) { _save_scene(p_file); - _run(false); } } break; -- cgit v1.2.3 From 7a0e4c822caa0d91506f693cb0cea2188927939f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 7 Jan 2015 01:45:46 -0300 Subject: -Visual Shader Editing Finished, PLEASE TEST! --- tools/editor/icons/icon_graph_comment.png | Bin 0 -> 310 bytes tools/editor/icons/icon_graph_cube_uniform.png | Bin 0 -> 652 bytes tools/editor/icons/icon_graph_input.png | Bin 0 -> 585 bytes tools/editor/icons/icon_graph_rgb.png | Bin 0 -> 174 bytes tools/editor/icons/icon_graph_rgb_op.png | Bin 0 -> 280 bytes tools/editor/icons/icon_graph_rgb_uniform.png | Bin 0 -> 419 bytes tools/editor/icons/icon_graph_scalar.png | Bin 0 -> 328 bytes tools/editor/icons/icon_graph_scalar_interp.png | Bin 0 -> 352 bytes tools/editor/icons/icon_graph_scalar_op.png | Bin 0 -> 238 bytes tools/editor/icons/icon_graph_scalar_uniform.png | Bin 0 -> 392 bytes tools/editor/icons/icon_graph_scalars_to_vec.png | Bin 0 -> 300 bytes tools/editor/icons/icon_graph_texscreen.png | Bin 0 -> 578 bytes tools/editor/icons/icon_graph_texture_uniform.png | Bin 0 -> 358 bytes tools/editor/icons/icon_graph_time.png | Bin 0 -> 678 bytes tools/editor/icons/icon_graph_vec_dp.png | Bin 0 -> 279 bytes tools/editor/icons/icon_graph_vec_interp.png | Bin 0 -> 332 bytes tools/editor/icons/icon_graph_vec_length.png | Bin 0 -> 303 bytes tools/editor/icons/icon_graph_vec_op.png | Bin 0 -> 256 bytes tools/editor/icons/icon_graph_vec_scalar_op.png | Bin 0 -> 267 bytes tools/editor/icons/icon_graph_vec_to_scalars.png | Bin 0 -> 306 bytes tools/editor/icons/icon_graph_vecs_to_xform.png | Bin 0 -> 288 bytes tools/editor/icons/icon_graph_vector.png | Bin 0 -> 480 bytes tools/editor/icons/icon_graph_vector_uniform.png | Bin 0 -> 531 bytes tools/editor/icons/icon_graph_xform.png | Bin 0 -> 262 bytes tools/editor/icons/icon_graph_xform_mult.png | Bin 0 -> 311 bytes .../editor/icons/icon_graph_xform_scalar_func.png | Bin 0 -> 378 bytes tools/editor/icons/icon_graph_xform_to_vecs.png | Bin 0 -> 272 bytes tools/editor/icons/icon_graph_xform_uniform.png | Bin 0 -> 346 bytes tools/editor/icons/icon_graph_xform_vec_func.png | Bin 0 -> 389 bytes tools/editor/icons/icon_graph_xform_vec_imult.png | Bin 0 -> 430 bytes tools/editor/icons/icon_graph_xform_vec_mult.png | Bin 0 -> 422 bytes .../editor/plugins/shader_graph_editor_plugin.cpp | 137 ++++++++++++++------- tools/editor/plugins/shader_graph_editor_plugin.h | 2 + 33 files changed, 92 insertions(+), 47 deletions(-) create mode 100644 tools/editor/icons/icon_graph_comment.png create mode 100644 tools/editor/icons/icon_graph_cube_uniform.png create mode 100644 tools/editor/icons/icon_graph_input.png create mode 100644 tools/editor/icons/icon_graph_rgb.png create mode 100644 tools/editor/icons/icon_graph_rgb_op.png create mode 100644 tools/editor/icons/icon_graph_rgb_uniform.png create mode 100644 tools/editor/icons/icon_graph_scalar.png create mode 100644 tools/editor/icons/icon_graph_scalar_interp.png create mode 100644 tools/editor/icons/icon_graph_scalar_op.png create mode 100644 tools/editor/icons/icon_graph_scalar_uniform.png create mode 100644 tools/editor/icons/icon_graph_scalars_to_vec.png create mode 100644 tools/editor/icons/icon_graph_texscreen.png create mode 100644 tools/editor/icons/icon_graph_texture_uniform.png create mode 100644 tools/editor/icons/icon_graph_time.png create mode 100644 tools/editor/icons/icon_graph_vec_dp.png create mode 100644 tools/editor/icons/icon_graph_vec_interp.png create mode 100644 tools/editor/icons/icon_graph_vec_length.png create mode 100644 tools/editor/icons/icon_graph_vec_op.png create mode 100644 tools/editor/icons/icon_graph_vec_scalar_op.png create mode 100644 tools/editor/icons/icon_graph_vec_to_scalars.png create mode 100644 tools/editor/icons/icon_graph_vecs_to_xform.png create mode 100644 tools/editor/icons/icon_graph_vector.png create mode 100644 tools/editor/icons/icon_graph_vector_uniform.png create mode 100644 tools/editor/icons/icon_graph_xform.png create mode 100644 tools/editor/icons/icon_graph_xform_mult.png create mode 100644 tools/editor/icons/icon_graph_xform_scalar_func.png create mode 100644 tools/editor/icons/icon_graph_xform_to_vecs.png create mode 100644 tools/editor/icons/icon_graph_xform_uniform.png create mode 100644 tools/editor/icons/icon_graph_xform_vec_func.png create mode 100644 tools/editor/icons/icon_graph_xform_vec_imult.png create mode 100644 tools/editor/icons/icon_graph_xform_vec_mult.png (limited to 'tools') diff --git a/tools/editor/icons/icon_graph_comment.png b/tools/editor/icons/icon_graph_comment.png new file mode 100644 index 0000000000..bf7889c510 Binary files /dev/null and b/tools/editor/icons/icon_graph_comment.png differ diff --git a/tools/editor/icons/icon_graph_cube_uniform.png b/tools/editor/icons/icon_graph_cube_uniform.png new file mode 100644 index 0000000000..d1b92b4943 Binary files /dev/null and b/tools/editor/icons/icon_graph_cube_uniform.png differ diff --git a/tools/editor/icons/icon_graph_input.png b/tools/editor/icons/icon_graph_input.png new file mode 100644 index 0000000000..a396bc2350 Binary files /dev/null and b/tools/editor/icons/icon_graph_input.png differ diff --git a/tools/editor/icons/icon_graph_rgb.png b/tools/editor/icons/icon_graph_rgb.png new file mode 100644 index 0000000000..abffaedd34 Binary files /dev/null and b/tools/editor/icons/icon_graph_rgb.png differ diff --git a/tools/editor/icons/icon_graph_rgb_op.png b/tools/editor/icons/icon_graph_rgb_op.png new file mode 100644 index 0000000000..642fc838c2 Binary files /dev/null and b/tools/editor/icons/icon_graph_rgb_op.png differ diff --git a/tools/editor/icons/icon_graph_rgb_uniform.png b/tools/editor/icons/icon_graph_rgb_uniform.png new file mode 100644 index 0000000000..92c79997ef Binary files /dev/null and b/tools/editor/icons/icon_graph_rgb_uniform.png differ diff --git a/tools/editor/icons/icon_graph_scalar.png b/tools/editor/icons/icon_graph_scalar.png new file mode 100644 index 0000000000..028d0e9ea4 Binary files /dev/null and b/tools/editor/icons/icon_graph_scalar.png differ diff --git a/tools/editor/icons/icon_graph_scalar_interp.png b/tools/editor/icons/icon_graph_scalar_interp.png new file mode 100644 index 0000000000..4f178a27c4 Binary files /dev/null and b/tools/editor/icons/icon_graph_scalar_interp.png differ diff --git a/tools/editor/icons/icon_graph_scalar_op.png b/tools/editor/icons/icon_graph_scalar_op.png new file mode 100644 index 0000000000..0fc4cae94c Binary files /dev/null and b/tools/editor/icons/icon_graph_scalar_op.png differ diff --git a/tools/editor/icons/icon_graph_scalar_uniform.png b/tools/editor/icons/icon_graph_scalar_uniform.png new file mode 100644 index 0000000000..fc6590a8cf Binary files /dev/null and b/tools/editor/icons/icon_graph_scalar_uniform.png differ diff --git a/tools/editor/icons/icon_graph_scalars_to_vec.png b/tools/editor/icons/icon_graph_scalars_to_vec.png new file mode 100644 index 0000000000..7ca39a2f56 Binary files /dev/null and b/tools/editor/icons/icon_graph_scalars_to_vec.png differ diff --git a/tools/editor/icons/icon_graph_texscreen.png b/tools/editor/icons/icon_graph_texscreen.png new file mode 100644 index 0000000000..e183a8fa56 Binary files /dev/null and b/tools/editor/icons/icon_graph_texscreen.png differ diff --git a/tools/editor/icons/icon_graph_texture_uniform.png b/tools/editor/icons/icon_graph_texture_uniform.png new file mode 100644 index 0000000000..7517ac1d92 Binary files /dev/null and b/tools/editor/icons/icon_graph_texture_uniform.png differ diff --git a/tools/editor/icons/icon_graph_time.png b/tools/editor/icons/icon_graph_time.png new file mode 100644 index 0000000000..b61e45589f Binary files /dev/null and b/tools/editor/icons/icon_graph_time.png differ diff --git a/tools/editor/icons/icon_graph_vec_dp.png b/tools/editor/icons/icon_graph_vec_dp.png new file mode 100644 index 0000000000..059c3025e7 Binary files /dev/null and b/tools/editor/icons/icon_graph_vec_dp.png differ diff --git a/tools/editor/icons/icon_graph_vec_interp.png b/tools/editor/icons/icon_graph_vec_interp.png new file mode 100644 index 0000000000..daf7a00203 Binary files /dev/null and b/tools/editor/icons/icon_graph_vec_interp.png differ diff --git a/tools/editor/icons/icon_graph_vec_length.png b/tools/editor/icons/icon_graph_vec_length.png new file mode 100644 index 0000000000..60ade8c90a Binary files /dev/null and b/tools/editor/icons/icon_graph_vec_length.png differ diff --git a/tools/editor/icons/icon_graph_vec_op.png b/tools/editor/icons/icon_graph_vec_op.png new file mode 100644 index 0000000000..f2a7a51123 Binary files /dev/null and b/tools/editor/icons/icon_graph_vec_op.png differ diff --git a/tools/editor/icons/icon_graph_vec_scalar_op.png b/tools/editor/icons/icon_graph_vec_scalar_op.png new file mode 100644 index 0000000000..f0f4e7a196 Binary files /dev/null and b/tools/editor/icons/icon_graph_vec_scalar_op.png differ diff --git a/tools/editor/icons/icon_graph_vec_to_scalars.png b/tools/editor/icons/icon_graph_vec_to_scalars.png new file mode 100644 index 0000000000..a677a7cc53 Binary files /dev/null and b/tools/editor/icons/icon_graph_vec_to_scalars.png differ diff --git a/tools/editor/icons/icon_graph_vecs_to_xform.png b/tools/editor/icons/icon_graph_vecs_to_xform.png new file mode 100644 index 0000000000..51216c93eb Binary files /dev/null and b/tools/editor/icons/icon_graph_vecs_to_xform.png differ diff --git a/tools/editor/icons/icon_graph_vector.png b/tools/editor/icons/icon_graph_vector.png new file mode 100644 index 0000000000..9dfe47d757 Binary files /dev/null and b/tools/editor/icons/icon_graph_vector.png differ diff --git a/tools/editor/icons/icon_graph_vector_uniform.png b/tools/editor/icons/icon_graph_vector_uniform.png new file mode 100644 index 0000000000..611539fca7 Binary files /dev/null and b/tools/editor/icons/icon_graph_vector_uniform.png differ diff --git a/tools/editor/icons/icon_graph_xform.png b/tools/editor/icons/icon_graph_xform.png new file mode 100644 index 0000000000..22df472be4 Binary files /dev/null and b/tools/editor/icons/icon_graph_xform.png differ diff --git a/tools/editor/icons/icon_graph_xform_mult.png b/tools/editor/icons/icon_graph_xform_mult.png new file mode 100644 index 0000000000..5d0ce7982d Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_mult.png differ diff --git a/tools/editor/icons/icon_graph_xform_scalar_func.png b/tools/editor/icons/icon_graph_xform_scalar_func.png new file mode 100644 index 0000000000..e53f08a564 Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_scalar_func.png differ diff --git a/tools/editor/icons/icon_graph_xform_to_vecs.png b/tools/editor/icons/icon_graph_xform_to_vecs.png new file mode 100644 index 0000000000..847261f726 Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_to_vecs.png differ diff --git a/tools/editor/icons/icon_graph_xform_uniform.png b/tools/editor/icons/icon_graph_xform_uniform.png new file mode 100644 index 0000000000..94c9759b25 Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_uniform.png differ diff --git a/tools/editor/icons/icon_graph_xform_vec_func.png b/tools/editor/icons/icon_graph_xform_vec_func.png new file mode 100644 index 0000000000..f3ba528896 Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_vec_func.png differ diff --git a/tools/editor/icons/icon_graph_xform_vec_imult.png b/tools/editor/icons/icon_graph_xform_vec_imult.png new file mode 100644 index 0000000000..7e7330cb8c Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_vec_imult.png differ diff --git a/tools/editor/icons/icon_graph_xform_vec_mult.png b/tools/editor/icons/icon_graph_xform_vec_mult.png new file mode 100644 index 0000000000..f80a28c80d Binary files /dev/null and b/tools/editor/icons/icon_graph_xform_vec_mult.png differ diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 710f11e726..54e8268574 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -383,6 +383,41 @@ void ShaderGraphView::_connection_request(const String& p_from, int p_from_slot, ur->commit_action(); +} + +void ShaderGraphView::_disconnection_request(const String& p_from, int p_from_slot,const String& p_to,int p_to_slot) { + + UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); + + int from_idx=-1; + int to_idx=-1; + for (Map::Element *E=node_map.front();E;E=E->next()) { + + if (p_from==E->get()->get_name()) + from_idx=E->key(); + if (p_to==E->get()->get_name()) + to_idx=E->key(); + } + + ERR_FAIL_COND(from_idx==-1); + ERR_FAIL_COND(to_idx==-1); + + if (!graph->is_node_connected(type,from_idx,p_from_slot,to_idx,p_to_slot)) + return; //nothing to disconnect + + ur->create_action("Disconnect Graph Nodes"); + + List conns; + + graph->get_node_connections(type,&conns); + //disconnect/reconnect dependencies + ur->add_do_method(graph.ptr(),"disconnect_node",type,from_idx,p_from_slot,to_idx,p_to_slot); + ur->add_undo_method(graph.ptr(),"connect_node",type,from_idx,p_from_slot,to_idx,p_to_slot); + ur->add_do_method(this,"_update_graph"); + ur->add_undo_method(this,"_update_graph"); + ur->commit_action(); + + } void ShaderGraphView::_node_removed(int p_id) { @@ -433,8 +468,8 @@ void ShaderGraphView::_create_node(int p_id) { GraphNode *gn = memnew( GraphNode ); gn->set_show_close_button(true); Color typecol[4]={ - Color(0.2,1,0.2), - Color(0.7,0.1,1), + Color(0.9,0.4,1), + Color(0.8,1,0.2), Color(1,0.2,0.2), Color(0,1,1) }; @@ -1262,6 +1297,7 @@ void ShaderGraphView::_bind_methods() { ObjectTypeDB::bind_method("_move_node",&ShaderGraphView::_move_node); ObjectTypeDB::bind_method("_node_removed",&ShaderGraphView::_node_removed); ObjectTypeDB::bind_method("_connection_request",&ShaderGraphView::_connection_request); + ObjectTypeDB::bind_method("_disconnection_request",&ShaderGraphView::_disconnection_request); ObjectTypeDB::bind_method("_scalar_const_changed",&ShaderGraphView::_scalar_const_changed); ObjectTypeDB::bind_method("_vec_const_changed",&ShaderGraphView::_vec_const_changed); @@ -1318,6 +1354,22 @@ void ShaderGraphEditor::_add_node(int p_type) { void ShaderGraphEditor::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { + + for(int i=0;iget_popup()->add_icon_item(get_icon(ic,"EditorIcons"),v,i); + if (addsep) + menu->get_popup()->add_separator(); + } menu->get_popup()->connect("item_pressed",this,"_add_node"); @@ -1332,38 +1384,38 @@ void ShaderGraphEditor::_bind_methods() { const char* ShaderGraphEditor::node_names[ShaderGraph::NODE_TYPE_MAX]={ - "Input", // all inputs (shader type dependent) - "Scalar Constant", //scalar constant - "Vector Constant", //vec3 constant - "RGB Constant", //rgb constant (shows a color picker instead) - "XForm Constant", // 4x4 matrix constant - "Time:", // time in seconds - "Screen Sample", // screen texture sampler (takes uv) (only usable in fragment shader) - "Scalar Operator", // scalar vs scalar op (mul", add", div", etc) - "Vector Operator", // vec3 vs vec3 op (mul",ad",div",crossprod",etc) - "Scalar+Vector Operator", // vec3 vs scalar op (mul", add", div", etc) - "RGB Operator:", // vec3 vs vec3 rgb op (with scalar amount)", like brighten", darken", burn", dodge", multiply", etc. - "XForm Multiply", // mat4 x mat4 - "XForm+Vector Multiply", // mat4 x vec3 mult (with no-translation option) - "XForm+Vector InvMultiply:", // mat4 x vec3 inverse mult (with no-translation option) - "Scalar Function", // scalar function (sin", cos", etc) - "Vector Function", // vector function (normalize", negate", reciprocal", rgb2hsv", hsv2rgb", etc", etc) - "Vector Length", // vec3 length - "Dot Product:", // vec3 . vec3 (dot product -> scalar output) - "Vector -> Scalars", // 1 vec3 input", 3 scalar outputs - "Scalars -> Vector", // 3 scalar input", 1 vec3 output - "XForm -> Vectors", // 3 vec input", 1 xform output - "Vectors -> XForm:", // 3 vec input", 1 xform output - "Scalar Interpolate", // scalar interpolation (with optional curve) - "Vector Interpolate:", // vec3 interpolation (with optional curve) - "Scalar Uniform", // scalar uniform (assignable in material) - "Vector Uniform", // vec3 uniform (assignable in material) - "RGB Uniform", // color uniform (assignable in material) - "XForm Uniform", // mat4 uniform (assignable in material) - "Texture Uniform", // texture input (assignable in material) - "CubeMap Uniform:", // cubemap input (assignable in material) + "GraphInput:Input", // all inputs (shader type dependent) + "GraphScalar:Scalar Constant", //scalar constant + "GraphVector:Vector Constant", //vec3 constant + "GraphRgb:RGB Constant", //rgb constant (shows a color picker instead) + "GraphXform:XForm Constant", // 4x4 matrix constant + "GraphTime:Time:", // time in seconds + "GraphTexscreen:Screen Sample", // screen texture sampler (takes uv) (only usable in fragment shader) + "GraphScalarOp:Scalar Operator", // scalar vs scalar op (mul", add", div", etc) + "GraphVecOp:Vector Operator", // vec3 vs vec3 op (mul",ad",div",crossprod",etc) + "GraphVecScalarOp:Scalar+Vector Operator", // vec3 vs scalar op (mul", add", div", etc) + "GraphRgbOp:RGB Operator:", // vec3 vs vec3 rgb op (with scalar amount)", like brighten", darken", burn", dodge", multiply", etc. + "GraphXformMult:XForm Multiply", // mat4 x mat4 + "GraphXformVecMult:XForm+Vector Multiply", // mat4 x vec3 mult (with no-translation option) + "GraphXformVecImult:Form+Vector InvMultiply:", // mat4 x vec3 inverse mult (with no-translation option) + "GraphXformScalarFunc:Scalar Function", // scalar function (sin", cos", etc) + "GraphXformVecFunc:Vector Function", // vector function (normalize", negate", reciprocal", rgb2hsv", hsv2rgb", etc", etc) + "GraphVecLength:Vector Length", // vec3 length + "GraphVecDp:Dot Product:", // vec3 . vec3 (dot product -> scalar output) + "GraphVecToScalars:Vector -> Scalars", // 1 vec3 input", 3 scalar outputs + "GraphScalarsToVec:Scalars -> Vector", // 3 scalar input", 1 vec3 output + "GraphXformToVecs:XForm -> Vectors", // 3 vec input", 1 xform output + "GraphVecsToXform:Vectors -> XForm:", // 3 vec input", 1 xform output + "GraphScalarInterp:Scalar Interpolate", // scalar interpolation (with optional curve) + "GraphVecInterp:Vector Interpolate:", // vec3 interpolation (with optional curve) + "GraphScalarUniform:Scalar Uniform", // scalar uniform (assignable in material) + "GraphVectorUniform:Vector Uniform", // vec3 uniform (assignable in material) + "GraphRgbUniform:RGB Uniform", // color uniform (assignable in material) + "GraphXformUniform:XForm Uniform", // mat4 uniform (assignable in material) + "GraphTextureUniform:Texture Uniform", // texture input (assignable in material) + "GraphCubeUniform:CubeMap Uniform:", // cubemap input (assignable in material) "Output", // output (shader type dependent) - "Comment", // comment + "GraphComment:Comment", // comment }; @@ -1374,20 +1426,7 @@ ShaderGraphEditor::ShaderGraphEditor() { menu->set_text("Add.."); hbc->add_child(menu); add_child(hbc); - for(int i=0;iget_popup()->add_item(v,i); - if (addsep) - menu->get_popup()->add_separator(); - } + tabs = memnew(TabContainer); tabs->set_v_size_flags(SIZE_EXPAND_FILL); @@ -1404,8 +1443,12 @@ ShaderGraphEditor::ShaderGraphEditor() { graph_edits[i]->get_graph_edit()->set_name(sname[i]); tabs->add_child(graph_edits[i]->get_graph_edit()); graph_edits[i]->get_graph_edit()->connect("connection_request",graph_edits[i],"_connection_request"); + graph_edits[i]->get_graph_edit()->connect("disconnection_request",graph_edits[i],"_disconnection_request"); + graph_edits[i]->get_graph_edit()->set_right_disconnects(true); } + tabs->set_current_tab(1); + set_custom_minimum_size(Size2(100,300)); } diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index 26dbd1ac6e..8be3b3293e 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -66,6 +66,8 @@ class ShaderGraphView : public Node { void _connection_request(const String& p_from, int p_from_slot,const String& p_to,int p_to_slot); + void _disconnection_request(const String& p_from, int p_from_slot,const String& p_to,int p_to_slot); + void _node_removed(int p_id); void _node_moved(const Vector2& p_from, const Vector2& p_to,int p_id); void _move_node(int p_id,const Vector2& p_to); -- cgit v1.2.3 From 1659f82e7e178c5bd6ff2fe02b600669b427245e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 7 Jan 2015 19:48:38 -0300 Subject: -changed type of C component of vec interp, fixes #1144 --- tools/editor/plugins/shader_graph_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 54e8268574..5100a8f675 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -1002,7 +1002,7 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_slot(0,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],false,0,Color()); - gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],false,0,Color()); + gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR],false,0,Color()); } break; // vec3 interpolation (with optional curve) case ShaderGraph::NODE_SCALAR_INPUT: { -- cgit v1.2.3 From 3f1dd9c57ff684e1d2441da43c6da8a19b507973 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 7 Jan 2015 20:29:05 -0300 Subject: -Fixed matrix and vec+scalar multiplication issues, fixes #1143 --- .../editor/plugins/shader_graph_editor_plugin.cpp | 35 +++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 5100a8f675..e0629fdda9 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -745,14 +745,9 @@ void ShaderGraphView::_create_node(int p_id) { } break; // mat4 x mat4 - case ShaderGraph::NODE_XFORM_VEC_MULT: - case ShaderGraph::NODE_XFORM_VEC_INV_MULT: { - - if (graph->node_get_type(type,p_id)==ShaderGraph::NODE_XFORM_VEC_INV_MULT) - gn->set_title("XFVecMult"); - else - gn->set_title("XFVecInvMult"); + case ShaderGraph::NODE_XFORM_VEC_MULT: { + gn->set_title("XFVecMult"); Button *button = memnew( Button("RotOnly")); button->set_toggle_mode(true); @@ -774,6 +769,32 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_XFORM,typecol[ShaderGraph::SLOT_TYPE_XFORM],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],false,0,Color()); + } break; + case ShaderGraph::NODE_XFORM_VEC_INV_MULT: { + + gn->set_title("XFVecInvMult"); + + + Button *button = memnew( Button("RotOnly")); + button->set_toggle_mode(true); + button->set_pressed(graph->xform_vec_mult_node_get_no_translation(type,p_id)); + button->connect("toggled",this,"_xform_inv_rev_changed",varray(p_id)); + + gn->add_child(button); + + gn->add_child( memnew(Label("vec"))); + HBoxContainer *hbc = memnew( HBoxContainer ); + hbc->add_constant_override("separation",0); + hbc->add_child( memnew(Label("xf"))); + hbc->add_spacer(); + Label *l = memnew(Label("out")); + l->set_align(Label::ALIGN_RIGHT); + hbc->add_child( l); + gn->add_child(hbc); + + gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],false,0,Color()); + gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_XFORM,typecol[ShaderGraph::SLOT_TYPE_XFORM],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); + } break; // mat4 x vec3 inverse mult (with no-translation option) case ShaderGraph::NODE_SCALAR_FUNC: { -- cgit v1.2.3 From 78f4b937034c8bc24c2a871b1fc08ecbe39d0e5e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 8 Jan 2015 00:41:34 -0300 Subject: Fixes to GraphEdit: -Working area is bigger now, solves #1148 -Using Position now works, fixes #1141 -RGB ops now work, fixes #1139 -Missing bindings to GraphEdit and GraphNode added -Shader Graph Editor Shows errors on cyclic links and missing connections --- .../editor/plugins/shader_graph_editor_plugin.cpp | 43 ++++++++++++++++++---- tools/editor/plugins/shader_graph_editor_plugin.h | 3 +- 2 files changed, 37 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index e0629fdda9..0a206c4a45 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -200,7 +200,7 @@ void ShaderGraphView::_vec_input_changed(double p_value, int p_id,Array p_arr){ } void ShaderGraphView::_xform_input_changed(int p_id, Node *p_button){ - print_line("XFIC"); + ToolButton *tb = p_button->cast_to(); ped_popup->set_pos(tb->get_global_pos()+Vector2(0,tb->get_size().height)); ped_popup->set_size(tb->get_size()); @@ -445,7 +445,7 @@ void ShaderGraphView::_node_removed(int p_id) { void ShaderGraphView::_node_moved(const Vector2& p_from, const Vector2& p_to,int p_id) { - print_line("moved from "+p_from+" to "+p_to); + ERR_FAIL_COND(!node_map.has(p_id)); UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); ur->create_action("Move Shader Graph Node"); @@ -1213,7 +1213,7 @@ void ShaderGraphView::_create_node(int p_id) { graph_edit->add_child(gn); node_map[p_id]=gn; gn->set_offset(graph->node_get_pos(type,p_id)); - print_line("NODE "+itos(p_id)+" OFS "+gn->get_offset()); + } @@ -1236,7 +1236,7 @@ void ShaderGraphView::_update_graph() { List nl; graph->get_node_list(type,&nl); - print_line("graph nodes: "+itos(nl.size())); + for(List::Element *E=nl.front();E;E=E->next()) { _create_node(E->get()); @@ -1255,11 +1255,29 @@ void ShaderGraphView::_update_graph() { } +void ShaderGraphView::_sg_updated() { + + if (!graph.is_valid()) + return; + switch(graph->get_graph_error(type)) { + case ShaderGraph::GRAPH_OK: status->set_text(""); break; + case ShaderGraph::GRAPH_ERROR_CYCLIC: status->set_text("Error: Cyclic Connection Link"); break; + case ShaderGraph::GRAPH_ERROR_MISSING_CONNECTIONS: status->set_text("Error: Missing Input Connections"); break; + } +} + void ShaderGraphView::set_graph(Ref p_graph){ - print_line("GRAPH EDIT: "+itos(p_graph.is_valid())); + + if (graph.is_valid()) { + graph->disconnect("updated",this,"_sg_updated"); + } graph=p_graph; + if (graph.is_valid()) { + graph->connect("updated",this,"_sg_updated"); + } _update_graph(); + _sg_updated(); } @@ -1343,6 +1361,7 @@ void ShaderGraphView::_bind_methods() { ObjectTypeDB::bind_method("_cube_edited",&ShaderGraphView::_cube_edited); ObjectTypeDB::bind_method("_comment_edited",&ShaderGraphView::_comment_edited); + ObjectTypeDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated); } ShaderGraphView::ShaderGraphView(ShaderGraph::ShaderType p_type) { @@ -1352,8 +1371,15 @@ ShaderGraphView::ShaderGraphView(ShaderGraph::ShaderType p_type) { block_update=false; ped_popup = memnew( CustomPropertyEditor ); graph_edit->add_child(ped_popup); - - + status = memnew( Label ); + graph_edit->get_top_layer()->add_child(status); + status->set_pos(Vector2(5,5)); + status->add_color_override("font_color_shadow",Color(0,0,0)); + status->add_color_override("font_color",Color(1,0.4,0.3)); + status->add_constant_override("shadow_as_outline",1); + status->add_constant_override("shadow_offset_x",2); + status->add_constant_override("shadow_offset_y",2); + status->set_text(""); } @@ -1444,7 +1470,7 @@ ShaderGraphEditor::ShaderGraphEditor() { HBoxContainer *hbc = memnew( HBoxContainer ); menu = memnew( MenuButton ); - menu->set_text("Add.."); + menu->set_text("Add Node.."); hbc->add_child(menu); add_child(hbc); @@ -1466,6 +1492,7 @@ ShaderGraphEditor::ShaderGraphEditor() { graph_edits[i]->get_graph_edit()->connect("connection_request",graph_edits[i],"_connection_request"); graph_edits[i]->get_graph_edit()->connect("disconnection_request",graph_edits[i],"_disconnection_request"); graph_edits[i]->get_graph_edit()->set_right_disconnects(true); + } tabs->set_current_tab(1); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index 8be3b3293e..bd983c59be 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -54,6 +54,7 @@ class ShaderGraphView : public Node { CustomPropertyEditor *ped_popup; bool block_update; + Label *status; GraphEdit *graph_edit; Ref graph; int edited_id; @@ -95,7 +96,7 @@ class ShaderGraphView : public Node { void _variant_edited(); void _comment_edited(int p_id,Node* p_button); - + void _sg_updated(); Map node_map; protected: void _notification(int p_what); -- cgit v1.2.3 From f1b9994cbcb682defb745e2d69503984324416be Mon Sep 17 00:00:00 2001 From: Maximillian Date: Thu, 8 Jan 2015 09:14:56 -0700 Subject: Fix process being debugged has exited pop up #1128 --- tools/editor/script_editor_debugger.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'tools') diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 024377ad18..5043c5cdcd 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -478,8 +478,6 @@ void ScriptEditorDebugger::_notification(int p_what) { if (!connection->is_connected()) { stop(); editor->notify_child_process_exited(); //somehow, exited - msgdialog->set_text("Process being debugged exited."); - msgdialog->popup_centered(Size2(250,100)); break; }; -- cgit v1.2.3 From e2f5cf3ef0962e0867cd44ea3e7727bb075ffe91 Mon Sep 17 00:00:00 2001 From: marynate Date: Fri, 9 Jan 2015 11:19:21 +0800 Subject: Fix compile error when tools=no --- tools/SCsub | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/SCsub b/tools/SCsub index 4d8b05fe79..ce7df2c35b 100644 --- a/tools/SCsub +++ b/tools/SCsub @@ -13,11 +13,9 @@ if (env["tools"]!="no"): SConscript('freetype/SCsub'); SConscript('doc/SCsub') SConscript('pck/SCsub') - + lib = env.Library("tool",env.tool_sources) -lib = env.Library("tool",env.tool_sources) - -env.Prepend(LIBS=[lib]) + env.Prepend(LIBS=[lib]) -- cgit v1.2.3 From 66a2adbf4badc7f97923e9e2c02d8f1b807d560e Mon Sep 17 00:00:00 2001 From: Dana Olson Date: Fri, 9 Jan 2015 01:36:38 -0500 Subject: mergable version of ndee's pull request --- tools/export/blender25/godot_export_manager.py | 439 ++++++++++++++++++++++ tools/export/blender25/io_scene_dae/export_dae.py | 71 ++-- 2 files changed, 488 insertions(+), 22 deletions(-) create mode 100644 tools/export/blender25/godot_export_manager.py (limited to 'tools') diff --git a/tools/export/blender25/godot_export_manager.py b/tools/export/blender25/godot_export_manager.py new file mode 100644 index 0000000000..a5df60e47d --- /dev/null +++ b/tools/export/blender25/godot_export_manager.py @@ -0,0 +1,439 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# Script copyright (c) Andreas Esau + +bl_info = { + "name": "Godot Export Manager", + "author": "Andreas Esau", + "version": (1, 0), + "blender": (2, 7, 0), + "location": "Scene Properties > Godot Export Manager", + "description": "Godot Export Manager uses the Better Collada Exporter to manage Export Groups and automatically export the objects groups to Collada Files.", + "warning": "", + "wiki_url": ("http://www.godotengine.org"), + "tracker_url": "", + "category": "Import-Export"} + +import bpy +from bpy.props import StringProperty, BoolProperty, EnumProperty, FloatProperty, FloatVectorProperty, IntProperty, CollectionProperty, PointerProperty +import os +from bpy.app.handlers import persistent +from mathutils import Vector, Matrix + +class godot_export_manager(bpy.types.Panel): + bl_label = "Godot Export Manager" + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "scene" + + bpy.types.Scene.godot_export_on_save = BoolProperty(default=False) + + ### draw function for all ui elements + def draw(self, context): + layout = self.layout + split = self.layout.split() + scene = bpy.data.scenes[0] + ob = context.object + scene = context.scene + + row = layout.row() + col = row.column() + col.prop(scene,"godot_export_on_save",text="Export Groups on save") + + row = layout.row() + col = row.column(align=True) + op = col.operator("scene.godot_add_objects_to_group",text="Add selected objects to Group",icon="COPYDOWN") + + op = col.operator("scene.godot_delete_objects_from_group",text="Delete selected objects from Group",icon="PASTEDOWN") + + + + row = layout.row() + col = row.column() + col.label(text="Export Groups:") + + + row = layout.row() + col = row.column() + + col.template_list("UI_List_Godot","dummy",scene, "godot_export_groups", scene, "godot_export_groups_index",rows=1,maxrows=10,type='DEFAULT') + + col = row.column(align=True) + col.operator("scene.godot_add_export_group",text="",icon="ZOOMIN") + col.operator("scene.godot_delete_export_group",text="",icon="ZOOMOUT") + col.operator("scene.godot_export_all_groups",text="",icon="EXPORT") + + if len(scene.godot_export_groups) > 0: + row = layout.row() + col = row.column() + group = scene.godot_export_groups[scene.godot_export_groups_index] + col.prop(group,"name",text="Group Name") + col.prop(group,"export_name",text="Export Name") + col.prop(group,"export_path",text="Export Filepath") + + row = layout.row() + col = row.column() + row = layout.row() + col = row.column() + col.label(text="Export Settings:") + + col = col.row(align=True) + col.prop(group,"apply_loc",toggle=True,icon="MAN_TRANS") + col.prop(group,"apply_rot",toggle=True,icon="MAN_ROT") + col.prop(group,"apply_scale",toggle=True,icon="MAN_SCALE") + + row = layout.row() + col = row.column() + + col.prop(group,"use_mesh_modifiers") + col.prop(group,"use_tangent_arrays") + col.prop(group,"use_triangles") + col.prop(group,"use_copy_images") + col.prop(group,"use_active_layers") + col.prop(group,"use_exclude_ctrl_bones") + col.prop(group,"use_anim") + col.prop(group,"use_anim_action_all") + col.prop(group,"use_anim_skip_noexp") + col.prop(group,"use_anim_optimize") + col.prop(group,"anim_optimize_precision") + col.prop(group,"use_metadata") + +### Custom template_list look +class UI_List_Godot(bpy.types.UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + ob = data + slot = item + col = layout.row(align=True) + + col.label(text=item.name,icon="GROUP") + col.prop(item,"active",text="") + + op = col.operator("scene.godot_select_group_objects",text="",emboss=False,icon="RESTRICT_SELECT_OFF") + op.idx = index + op = col.operator("scene.godot_export_group",text="",emboss=False,icon="EXPORT") + op.idx = index + +class add_objects_to_group(bpy.types.Operator): + bl_idname = "scene.godot_add_objects_to_group" + bl_label = "Add Objects to Group" + bl_description = "Adds the selected Objects to the active group below." + + def execute(self,context): + scene = context.scene + + objects_str = "" + if len(scene.godot_export_groups) > 0: + for i,object in enumerate(context.selected_objects): + if object.name not in scene.godot_export_groups[scene.godot_export_groups_index].nodes: + node = scene.godot_export_groups[scene.godot_export_groups_index].nodes.add() + node.name = object.name + if i == 0: + objects_str += object.name + else: + objects_str += ", "+object.name + + + self.report({'INFO'}, objects_str + " added to group." ) + bpy.ops.ed.undo_push(message="Objects added to group") + else: + self.report({'WARNING'}, "Create a group first." ) + return{'FINISHED'} + +class del_objects_from_group(bpy.types.Operator): + bl_idname = "scene.godot_delete_objects_from_group" + bl_label = "Delete Objects from Group" + bl_description = "Delets the selected Objects from the active group below." + + def execute(self,context): + scene = context.scene + + if len(scene.godot_export_groups) > 0: + + selected_objects = [] + for object in context.selected_objects: + selected_objects.append(object.name) + + objects_str = "" + j = 0 + for i,node in enumerate(scene.godot_export_groups[scene.godot_export_groups_index].nodes): + if node.name in selected_objects: + scene.godot_export_groups[scene.godot_export_groups_index].nodes.remove(i) + + + if j == 0: + objects_str += object.name + else: + objects_str += ", "+object.name + j+=1 + + + self.report({'INFO'}, objects_str + " deleted from group." ) + bpy.ops.ed.undo_push(message="Objects deleted from group") + else: + self.report({'WARNING'}, "There is no group to delete from." ) + return{'FINISHED'} + +class select_group_objects(bpy.types.Operator): + bl_idname = "scene.godot_select_group_objects" + bl_label = "Select Group Objects" + bl_description = "Will select all group Objects in the scene." + + idx = IntProperty() + + def execute(self,context): + scene = context.scene + for object in context.scene.objects: + object.select = False + for node in scene.godot_export_groups[self.idx].nodes: + if node.name in bpy.data.objects: + bpy.data.objects[node.name].select = True + context.scene.objects.active = bpy.data.objects[node.name] + return{'FINISHED'} + +class export_groups_autosave(bpy.types.Operator): + bl_idname = "scene.godot_export_groups_autosave" + bl_label = "Export All Groups" + bl_description = "Exports all groups to Collada." + + def execute(self,context): + scene = context.scene + if scene.godot_export_on_save: + for i in range(len(scene.godot_export_groups)): + if scene.godot_export_groups[i].active: + bpy.ops.scene.godot_export_group(idx=i) + self.report({'INFO'}, "All Groups exported." ) + bpy.ops.ed.undo_push(message="Export all Groups") + return{'FINISHED'} + +class export_all_groups(bpy.types.Operator): + bl_idname = "scene.godot_export_all_groups" + bl_label = "Export All Groups" + bl_description = "Exports all groups to Collada." + + def execute(self,context): + scene = context.scene + for i in range(len(scene.godot_export_groups)): + if scene.godot_export_groups[i].active: + bpy.ops.scene.godot_export_group(idx=i) + self.report({'INFO'}, "All Groups exported." ) + bpy.ops.ed.undo_push(message="Export all Groups") + return{'FINISHED'} + + +class export_group(bpy.types.Operator): + bl_idname = "scene.godot_export_group" + bl_label = "Export Group" + bl_description = "Exports the active group to destination folder as Collada file." + + idx = IntProperty(default=0) + + def copy_object_recursive(self,ob,parent,single_user = True): + new_ob = bpy.data.objects[ob.name].copy() + if single_user or ob.type=="ARMATURE": + new_mesh_data = new_ob.data.copy() + new_ob.data = new_mesh_data + bpy.context.scene.objects.link(new_ob) + + if ob != parent: + new_ob.parent = parent + else: + new_ob.parent = None + + for child in ob.children: + self.copy_object_recursive(child,new_ob,single_user) + new_ob.select = True + return new_ob + + def delete_object(self,ob): + if ob != None: + for child in ob.children: + self.delete_object(child) + bpy.context.scene.objects.unlink(ob) + bpy.data.objects.remove(ob) + + def convert_group_to_node(self,group): + if group.dupli_group != None: + for object in group.dupli_group.objects: + if object.parent == None: + object = self.copy_object_recursive(object,object,True) + matrix = Matrix(object.matrix_local) + object.matrix_local = Matrix() + object.matrix_local *= group.matrix_local + object.matrix_local *= matrix + + self.delete_object(group) + + def execute(self,context): + scene = context.scene + group = context.scene.godot_export_groups + + path = group[self.idx].export_path + if (path.find("//")==0 or path.find("\\\\")==0): + #if relative, convert to absolute + path = bpy.path.abspath(path) + path = path.replace("\\","/") + + ### if path exists and group export name is set the group will be exported + if os.path.exists(path) and group[self.idx].export_name != "": + + context.scene.layers = [True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True] + + + if group[self.idx].export_name.endswith(".dae"): + path = os.path.join(path,group[self.idx].export_name) + else: + path = os.path.join(path,group[self.idx].export_name+".dae") + + hide_select = [] + for object in context.scene.objects: + hide_select.append(object.hide_select) + object.hide_select = False + object.select = False + context.scene.objects.active = None + + for i,object in enumerate(group[self.idx].nodes): + + if object.name in bpy.data.objects: + if bpy.data.objects[object.name].type == "EMPTY": + self.convert_group_to_node(bpy.data.objects[object.name]) + else: + bpy.data.objects[object.name].select = True + + else: # if object is not in the scene anymore it will be removed from the group + group[self.idx].nodes.remove(i) + bpy.ops.object.transform_apply(location=group[self.idx].apply_loc, rotation=group[self.idx].apply_rot, scale=group[self.idx].apply_scale) + bpy.ops.export_scene.dae(check_existing=True, filepath=path, filter_glob="*.dae", object_types=group[self.idx].object_types, use_export_selected=group[self.idx].use_export_selected, use_mesh_modifiers=group[self.idx].use_mesh_modifiers, use_tangent_arrays=group[self.idx].use_tangent_arrays, use_triangles=group[self.idx].use_triangles, use_copy_images=group[self.idx].use_copy_images, use_active_layers=group[self.idx].use_active_layers, use_exclude_ctrl_bones=group[self.idx].use_exclude_ctrl_bones, use_anim=group[self.idx].use_anim, use_anim_action_all=group[self.idx].use_anim_action_all, use_anim_skip_noexp=group[self.idx].use_anim_skip_noexp, use_anim_optimize=group[self.idx].use_anim_optimize, anim_optimize_precision=group[self.idx].anim_optimize_precision, use_metadata=group[self.idx].use_metadata) + + + self.report({'INFO'}, '"'+group[self.idx].name+'"' + " Group exported." ) + msg = "Export Group "+group[self.idx].name + bpy.ops.ed.undo_push(message="") + bpy.ops.ed.undo() + bpy.ops.ed.undo_push(message=msg) + else: + self.report({'INFO'}, "Define Export Name and Export Path." ) + return{'FINISHED'} + +class add_export_group(bpy.types.Operator): + bl_idname = "scene.godot_add_export_group" + bl_label = "Adds a new export Group" + bl_description = "Creates a new Export Group with the selected Objects assigned to it." + + def execute(self,context): + scene = context.scene + + item = scene.godot_export_groups.add() + item.name = "New Group" + for object in context.selected_objects: + node = item.nodes.add() + node.name = object.name + scene.godot_export_groups_index = len(scene.godot_export_groups)-1 + bpy.ops.ed.undo_push(message="Create New Export Group") + return{'FINISHED'} + +class del_export_group(bpy.types.Operator): + bl_idname = "scene.godot_delete_export_group" + bl_label = "Delets the selected export Group" + bl_description = "Delets the active Export Group." + + def invoke(self, context, event): + wm = context.window_manager + return wm.invoke_confirm(self,event) + + def execute(self,context): + scene = context.scene + + scene.godot_export_groups.remove(scene.godot_export_groups_index) + if scene.godot_export_groups_index > 0: + scene.godot_export_groups_index -= 1 + bpy.ops.ed.undo_push(message="Delete Export Group") + return{'FINISHED'} + +class godot_node_list(bpy.types.PropertyGroup): + name = StringProperty() + +class godot_export_groups(bpy.types.PropertyGroup): + name = StringProperty(name="Group Name") + export_name = StringProperty(name="scene_name") + nodes = CollectionProperty(type=godot_node_list) + export_path = StringProperty(subtype="DIR_PATH") + active = BoolProperty(default=True,description="Export Group") + + object_types = EnumProperty(name="Object Types",options={'ENUM_FLAG'},items=(('EMPTY', "Empty", ""),('CAMERA', "Camera", ""),('LAMP', "Lamp", ""),('ARMATURE', "Armature", ""),('MESH', "Mesh", ""),('CURVE', "Curve", ""),),default={'EMPTY', 'CAMERA', 'LAMP', 'ARMATURE', 'MESH','CURVE'}) + + apply_scale = BoolProperty(name="Apply Scale",description="Apply Scale before export.",default=False) + apply_rot = BoolProperty(name="Apply Rotation",description="Apply Rotation before export.",default=False) + apply_loc = BoolProperty(name="Apply Location",description="Apply Location before export.",default=False) + + use_export_selected = BoolProperty(name="Selected Objects",description="Export only selected objects (and visible in active layers if that applies).",default=True) + use_mesh_modifiers = BoolProperty(name="Apply Modifiers",description="Apply modifiers to mesh objects (on a copy!).",default=True) + use_tangent_arrays = BoolProperty(name="Tangent Arrays",description="Export Tangent and Binormal arrays (for normalmapping).",default=False) + use_triangles = BoolProperty(name="Triangulate",description="Export Triangles instead of Polygons.",default=False) + + use_copy_images = BoolProperty(name="Copy Images",description="Copy Images (create images/ subfolder)",default=False) + use_active_layers = BoolProperty(name="Active Layers",description="Export only objects on the active layers.",default=True) + use_exclude_ctrl_bones = BoolProperty(name="Exclude Control Bones",description="Exclude skeleton bones with names that begin with 'ctrl'.",default=True) + use_anim = BoolProperty(name="Export Animation",description="Export keyframe animation",default=False) + use_anim_action_all = BoolProperty(name="All Actions",description=("Export all actions for the first armature found in separate DAE files"),default=False) + use_anim_skip_noexp = BoolProperty(name="Skip (-noexp) Actions",description="Skip exporting of actions whose name end in (-noexp). Useful to skip control animations.",default=True) + use_anim_optimize = BoolProperty(name="Optimize Keyframes",description="Remove double keyframes",default=True) + + anim_optimize_precision = FloatProperty(name="Precision",description=("Tolerence for comparing double keyframes (higher for greater accuracy)"),min=1, max=16,soft_min=1, soft_max=16,default=6.0) + + use_metadata = BoolProperty(name="Use Metadata",default=True,options={'HIDDEN'}) + +def register(): + bpy.utils.register_class(godot_export_manager) + bpy.utils.register_class(godot_node_list) + bpy.utils.register_class(godot_export_groups) + bpy.utils.register_class(add_export_group) + bpy.utils.register_class(del_export_group) + bpy.utils.register_class(export_all_groups) + bpy.utils.register_class(export_groups_autosave) + bpy.utils.register_class(export_group) + bpy.utils.register_class(add_objects_to_group) + bpy.utils.register_class(del_objects_from_group) + bpy.utils.register_class(select_group_objects) + bpy.utils.register_class(UI_List_Godot) + + bpy.types.Scene.godot_export_groups = CollectionProperty(type=godot_export_groups) + bpy.types.Scene.godot_export_groups_index = IntProperty(default=0,min=0) + +def unregister(): + bpy.utils.unregister_class(godot_export_manager) + bpy.utils.unregister_class(godot_node_list) + bpy.utils.unregister_class(godot_export_groups) + bpy.utils.unregister_class(export_groups_autosave) + bpy.utils.unregister_class(add_export_group) + bpy.utils.unregister_class(del_export_group) + bpy.utils.unregister_class(export_all_groups) + bpy.utils.unregister_class(export_group) + bpy.utils.unregister_class(add_objects_to_group) + bpy.utils.unregister_class(del_objects_from_group) + bpy.utils.unlregister_class(select_group_objects) + bpy.utils.unregister_class(UI_List_Godot) + +@persistent +def auto_export(dummy): + bpy.ops.scene.godot_export_groups_autosave() + +bpy.app.handlers.save_post.append(auto_export) + +if __name__ == "__main__": + register() diff --git a/tools/export/blender25/io_scene_dae/export_dae.py b/tools/export/blender25/io_scene_dae/export_dae.py index 4e1635429b..8161f05bf8 100644 --- a/tools/export/blender25/io_scene_dae/export_dae.py +++ b/tools/export/blender25/io_scene_dae/export_dae.py @@ -162,37 +162,61 @@ class DaeExporter: def export_image(self,image): - if (image in self.image_cache): return self.image_cache[image] - + imgpath = image.filepath if (imgpath.find("//")==0 or imgpath.find("\\\\")==0): #if relative, convert to absolute imgpath = bpy.path.abspath(imgpath) #path is absolute, now do something! - + if (self.config["use_copy_images"]): #copy image basedir = os.path.dirname(self.path)+"/images" if (not os.path.isdir(basedir)): os.makedirs(basedir) - dstfile=basedir+"/"+os.path.basename(imgpath) - if (not os.path.isfile(dstfile)): - shutil.copy(imgpath,dstfile) - imgpath="images/"+os.path.basename(imgpath) + + if os.path.isfile(imgpath): + dstfile=basedir+"/"+os.path.basename(imgpath) + + if (not os.path.isfile(dstfile)): + shutil.copy(imgpath,dstfile) + imgpath="images/"+os.path.basename(imgpath) + else: + ### if file is not found save it as png file in the destination folder + img_tmp_path = image.filepath + if img_tmp_path.endswith((".bmp",".rgb",".png",".jpeg",".jpg",".jp2",".tga",".cin",".dpx",".exr",".hdr",".tif")): + image.filepath = basedir+"/"+os.path.basename(img_tmp_path) + else: + image.filepath = basedir+"/"+image.name+".png" + + dstfile=basedir+"/"+os.path.basename(image.filepath) + + if (not os.path.isfile(dstfile)): + + image.save() + imgpath="images/"+os.path.basename(image.filepath) + image.filepath = img_tmp_path else: #export relative, always, no one wants absolute paths. try: imgpath = os.path.relpath(imgpath,os.path.dirname(self.path)).replace("\\","/") # export unix compatible always + except: pass #fails sometimes, not sure why - - + imgid = self.new_id("image") + + if (not os.path.isfile(imgpath)): + if img_tmp_path.endswith((".bmp",".rgb",".png",".jpeg",".jpg",".jp2",".tga",".cin",".dpx",".exr",".hdr",".tif")): + imgpath="images/"+os.path.basename(img_tmp_path) + else: + imgpath="images/"+image.name+".png" + self.writel(S_IMGS,1,'') self.writel(S_IMGS,2,''+imgpath+'"/>') self.writel(S_IMGS,1,'') @@ -1176,6 +1200,7 @@ class DaeExporter: def export_node(self,node,il): if (not node in self.valid_nodes): return + prev_node = bpy.context.scene.objects.active bpy.context.scene.objects.active = node self.writel(S_NODES,il,'') @@ -1199,6 +1224,7 @@ class DaeExporter: il-=1 self.writel(S_NODES,il,'') + bpy.context.scene.objects.active = prev_node #make previous node active again def is_node_valid(self,node): if (not node.type in self.config["object_types"]): @@ -1441,12 +1467,13 @@ class DaeExporter: return tcn def export_animations(self): - tmp_mat = [] # workaround by ndee - for s in self.skeletons: # workaround by ndee - tmp_bone_mat = [] # workaround by ndee - for bone in s.pose.bones: # workaround by ndee - tmp_bone_mat.append(Matrix(bone.matrix_basis)) # workaround by ndee - tmp_mat.append([Matrix(s.matrix_local),tmp_bone_mat]) # workaround by ndee -> stores skeleton and bone transformations + tmp_mat = [] + for s in self.skeletons: + tmp_bone_mat = [] + for bone in s.pose.bones: + tmp_bone_mat.append(Matrix(bone.matrix_basis)) + bone.matrix_basis = Matrix() + tmp_mat.append([Matrix(s.matrix_local),tmp_bone_mat]) self.writel(S_ANIM,0,'') @@ -1481,7 +1508,7 @@ class DaeExporter: bones.append(dp) allowed_skeletons=[] - for i,y in enumerate(self.skeletons): # workaround by ndee + for i,y in enumerate(self.skeletons): if (y.animation_data): for z in y.pose.bones: if (z.bone.name in bones): @@ -1489,9 +1516,9 @@ class DaeExporter: allowed_skeletons.append(y) y.animation_data.action=x; - y.matrix_local = tmp_mat[i][0] # workaround by ndee -> resets the skeleton transformation. - for j,bone in enumerate(s.pose.bones): # workaround by ndee - bone.matrix_basis = Matrix() # workaround by ndee -> resets the bone transformations. Important if bones in follwing actions miss keyframes + y.matrix_local = tmp_mat[i][0] + for j,bone in enumerate(s.pose.bones): + bone.matrix_basis = Matrix() print("allowed skeletons "+str(allowed_skeletons)) @@ -1511,15 +1538,15 @@ class DaeExporter: self.writel(S_ANIM_CLIPS,0,'') - for i,s in enumerate(self.skeletons): # workaround by ndee + for i,s in enumerate(self.skeletons): if (s.animation_data==None): continue if s in cached_actions: s.animation_data.action = bpy.data.actions[cached_actions[s]] else: s.animation_data.action = None - for j,bone in enumerate(s.pose.bones): # workaround by ndee - bone.matrix_basis = tmp_mat[i][1][j] # workaround by ndee -> resets the bone transformation to what they were before exporting. + for j,bone in enumerate(s.pose.bones): + bone.matrix_basis = tmp_mat[i][1][j] else: self.export_animation(self.scene.frame_start,self.scene.frame_end) -- cgit v1.2.3 From 9bbc3f0c94bfdbaceb507e4ccaf388950d84d8f0 Mon Sep 17 00:00:00 2001 From: Dana Olson Date: Sun, 11 Jan 2015 00:08:32 -0500 Subject: fix naming of duplicated nodes, closes #1161, adds separator character preferences --- tools/editor/editor_settings.cpp | 4 ++++ tools/editor/scene_tree_dock.cpp | 24 +++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index bc800d7e9e..60b8f41dab 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -413,6 +413,10 @@ void EditorSettings::_load_defaults() { set("text_editor/auto_brace_complete", false); + set("scenetree_editor/duplicate_node_name_num_separator",0); + hints["scenetree_editor/duplicate_node_name_num_separator"]=PropertyInfo(Variant::INT,"scenetree_editor/duplicate_node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"); + + set("3d_editor/default_fov",45.0); set("3d_editor/default_z_near",0.1); set("3d_editor/default_z_far",500.0); diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index f5d9e83bf8..cff3913579 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -100,6 +100,16 @@ Node* SceneTreeDock::instance(const String& p_file) { } +static String _get_name_num_separator() { + switch(EditorSettings::get_singleton()->get("scenetree_editor/duplicate_node_name_num_separator").operator int()) { + case 0: return ""; + case 1: return " "; + case 2: return "_"; + case 3: return "-"; + } + return " "; +} + void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { current_option=p_tool; @@ -318,17 +328,21 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } int num=nums.to_int(); - if (num<2) - num=2; + if (num<1) + num=1; else num++; - name=name.substr(0,name.length()-nums.length()).strip_edges(); - String attempt=name+" "+itos(num); + String nnsep = _get_name_num_separator(); + name = name.substr(0,name.length()-nums.length()).strip_edges(); + if ( name.substr(name.length()-nnsep.length(),nnsep.length()) == nnsep) { + name = name.substr(0,name.length()-nnsep.length()); + } + String attempt = (name + nnsep + itos(num)).strip_edges(); while(parent->has_node(attempt)) { num++; - attempt=name+" "+itos(num); + attempt = (name + nnsep + itos(num)).strip_edges(); } dup->set_name(attempt); -- cgit v1.2.3 From fc4d6765f15b6d17bceb5a045ae075fa515d862b Mon Sep 17 00:00:00 2001 From: BenH Date: Sun, 11 Jan 2015 12:18:10 +0000 Subject: Fixes #1160 Fixed curve handles not taking current zoom level into consideration when being dragged --- tools/editor/plugins/path_2d_editor_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index 33ea5f3588..49239343a5 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -195,7 +195,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { Ref curve = node->get_curve(); - Vector2 new_pos = moving_from + xform.basis_xform( gpoint - moving_screen_from ); + Vector2 new_pos = moving_from + xform.affine_inverse().basis_xform(gpoint - moving_screen_from); switch(action) { case ACTION_MOVING_POINT: { @@ -439,7 +439,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { Ref curve = node->get_curve(); - Vector2 new_pos = moving_from + xform.basis_xform( gpoint - moving_screen_from ); + Vector2 new_pos = moving_from + xform.affine_inverse().basis_xform(gpoint - moving_screen_from); switch(action) { -- cgit v1.2.3 From f3dc51fc69ec3a16c6b2a6834ff0a6d933b1ddca Mon Sep 17 00:00:00 2001 From: reduz Date: Sun, 11 Jan 2015 20:52:42 -0300 Subject: 2D shader progress --- tools/editor/editor_node.cpp | 3 +- tools/editor/editor_plugin.cpp | 6 ++ tools/editor/editor_plugin.h | 3 +- tools/editor/plugins/canvas_item_editor_plugin.cpp | 11 +++- tools/editor/plugins/canvas_item_editor_plugin.h | 3 +- tools/editor/plugins/shader_editor_plugin.cpp | 70 +++++++--------------- tools/editor/plugins/shader_editor_plugin.h | 6 +- 7 files changed, 47 insertions(+), 55 deletions(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 52c75c6d7e..f859d19504 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4036,7 +4036,8 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( EditorHelpPlugin(this) ) ); add_editor_plugin( memnew( AnimationPlayerEditorPlugin(this) ) ); add_editor_plugin( memnew( ShaderGraphEditorPlugin(this) ) ); - add_editor_plugin( memnew( ShaderEditorPlugin(this) ) ); + add_editor_plugin( memnew( ShaderEditorPlugin(this,true) ) ); + add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) ); add_editor_plugin( memnew( CameraEditorPlugin(this) ) ); add_editor_plugin( memnew( SampleEditorPlugin(this) ) ); add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) ); diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 2a2ad63d32..1bad1dc6ac 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -73,6 +73,12 @@ void EditorPlugin::add_custom_control(CustomControlContainer p_location,Control } break; case CONTAINER_CANVAS_EDITOR_SIDE: { + CanvasItemEditor::get_singleton()->get_palette_split()->add_child(p_control); + + } break; + case CONTAINER_CANVAS_EDITOR_BOTTOM: { + + CanvasItemEditor::get_singleton()->get_bottom_split()->add_child(p_control); } break; diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h index bcde0f73fb..4f2341d3b1 100644 --- a/tools/editor/editor_plugin.h +++ b/tools/editor/editor_plugin.h @@ -66,7 +66,8 @@ public: CONTAINER_SPATIAL_EDITOR_SIDE, CONTAINER_SPATIAL_EDITOR_BOTTOM, CONTAINER_CANVAS_EDITOR_MENU, - CONTAINER_CANVAS_EDITOR_SIDE + CONTAINER_CANVAS_EDITOR_SIDE, + CONTAINER_CANVAS_EDITOR_BOTTOM }; //TODO: send a resoucre for editing to the editor node? diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 43ebebeb22..514f4b6525 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -2688,6 +2688,11 @@ HSplitContainer *CanvasItemEditor::get_palette_split() { return palette_split; } +VSplitContainer *CanvasItemEditor::get_bottom_split() { + + return bottom_split; +} + CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { tool = TOOL_SELECT; @@ -2702,9 +2707,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { add_child( hb ); hb->set_area_as_parent_rect(); + bottom_split = memnew( VSplitContainer ); + bottom_split->set_v_size_flags(SIZE_EXPAND_FILL); + add_child(bottom_split); + palette_split = memnew( HSplitContainer); palette_split->set_v_size_flags(SIZE_EXPAND_FILL); - add_child(palette_split); + bottom_split->add_child(palette_split); Control *vp_base = memnew (Control); vp_base->set_v_size_flags(SIZE_EXPAND_FILL); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h index c56570d43f..6648d486e8 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.h +++ b/tools/editor/plugins/canvas_item_editor_plugin.h @@ -290,8 +290,8 @@ class CanvasItemEditor : public VBoxContainer { void _viewport_input_event(const InputEvent& p_event); void _viewport_draw(); -private: HSplitContainer *palette_split; + VSplitContainer *bottom_split; friend class CanvasItemEditorPlugin; protected: @@ -346,6 +346,7 @@ public: void add_control_to_menu_panel(Control *p_control); HSplitContainer *get_palette_split(); + VSplitContainer *get_bottom_split(); Control *get_viewport_control() { return viewport; } diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 3166383fc8..0349964310 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -57,9 +57,9 @@ void ShaderTextEditor::set_edited_shader(const Ref& p_shader,ShaderLangu _load_theme_settings(); - if (p_type==ShaderLanguage::SHADER_MATERIAL_LIGHT) + if (p_type==ShaderLanguage::SHADER_MATERIAL_LIGHT || p_type==ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT) get_text_edit()->set_text(shader->get_light_code()); - else if (p_type==ShaderLanguage::SHADER_MATERIAL_VERTEX) + else if (p_type==ShaderLanguage::SHADER_MATERIAL_VERTEX || p_type==ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX) get_text_edit()->set_text(shader->get_vertex_code()); else get_text_edit()->set_text(shader->get_fragment_code()); @@ -131,17 +131,12 @@ void ShaderTextEditor::_validate_script() { String errortxt; int line,col; - String code; - if (type==ShaderLanguage::SHADER_MATERIAL_LIGHT) - code=get_text_edit()->get_text(); - else if (type==ShaderLanguage::SHADER_MATERIAL_VERTEX) - code=get_text_edit()->get_text(); - else - code=get_text_edit()->get_text(); - + String code=get_text_edit()->get_text(); //List params; //shader->get_param_list(¶ms); + print_line("compile: type: "+itos(type)+" code:\n"+code); + Error err = ShaderLanguage::compile(code,type,NULL,NULL,&errortxt,&line,&col); if (err!=OK) { @@ -233,25 +228,7 @@ void ShaderEditor::_menu_option(int p_option) { goto_line_dialog->popup_find_line(current->get_text_edit()); } break; - case SHADER_POST_PROCESS_MODE:{ - - fragment_editor->set_edited_shader(shader,ShaderLanguage::SHADER_POST_PROCESS); - fragment_editor->_validate_script(); - apply_shaders(); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_MATERIAL_MODE), false); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_POST_PROCESS_MODE), true); - - - } break; - case SHADER_MATERIAL_MODE: { - fragment_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_FRAGMENT); - fragment_editor->_validate_script(); - apply_shaders(); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_MATERIAL_MODE), true); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_POST_PROCESS_MODE), false); - - } break; } } @@ -408,15 +385,14 @@ void ShaderEditor::edit(const Ref& p_shader) { shader=p_shader; if (shader->get_mode()==Shader::MODE_MATERIAL) { + vertex_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_MATERIAL_VERTEX); fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_MATERIAL_FRAGMENT); light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_LIGHT); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_MATERIAL_MODE), true); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_POST_PROCESS_MODE), false); - } else { + } else if (shader->get_mode()==Shader::MODE_CANVAS_ITEM) { - fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_POST_PROCESS); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_MATERIAL_MODE), false); - settings_menu->get_popup()->set_item_checked( settings_menu->get_popup()->get_item_index(SHADER_POST_PROCESS_MODE), true); + vertex_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX); + fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT); + light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT); } vertex_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_VERTEX); @@ -495,15 +471,6 @@ ShaderEditor::ShaderEditor() { search_menu->get_popup()->add_item("Goto Line..",SEARCH_GOTO_LINE,KEY_MASK_CMD|KEY_G); search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); - settings_menu = memnew( MenuButton ); - add_child(settings_menu); - settings_menu->set_pos(Point2(90,-1)); - settings_menu->set_text("Shader"); - settings_menu->get_popup()->add_check_item("Material Mode",SHADER_MATERIAL_MODE); - settings_menu->get_popup()->set_item_checked(settings_menu->get_popup()->get_item_index(SHADER_MATERIAL_MODE),true); - settings_menu->get_popup()->add_check_item("Post Process Mode",SHADER_POST_PROCESS_MODE); - - settings_menu->get_popup()->connect("item_pressed", this,"_menu_option"); tab_container->connect("tab_changed", this,"_tab_changed"); @@ -550,7 +517,13 @@ void ShaderEditorPlugin::edit(Object *p_object) { bool ShaderEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Shader"); + Shader *shader=p_object->cast_to(); + if (!shader) + return false; + if (_2d) + return shader->get_mode()==Shader::MODE_CANVAS_ITEM; + else + return shader->get_mode()==Shader::MODE_MATERIAL; } void ShaderEditorPlugin::make_visible(bool p_visible) { @@ -596,12 +569,15 @@ void ShaderEditorPlugin::apply_changes() { shader_editor->apply_shaders(); } -ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) { +ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) { editor=p_node; shader_editor = memnew( ShaderEditor ); - - SpatialEditor::get_singleton()->get_shader_split()->add_child(shader_editor); + _2d=p_2d; + if (p_2d) + add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,shader_editor); + else + add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,shader_editor); // editor->get_viewport()->add_child(shader_editor); // shader_editor->set_area_as_parent_rect(); diff --git a/tools/editor/plugins/shader_editor_plugin.h b/tools/editor/plugins/shader_editor_plugin.h index 49caee5da6..daaa0ccb94 100644 --- a/tools/editor/plugins/shader_editor_plugin.h +++ b/tools/editor/plugins/shader_editor_plugin.h @@ -79,9 +79,6 @@ class ShaderEditor : public Control { SEARCH_REPLACE, //SEARCH_LOCATE_SYMBOL, SEARCH_GOTO_LINE, - SHADER_MATERIAL_MODE, - SHADER_POST_PROCESS_MODE, - SHADER_SHADE_MODEL_MODE, }; @@ -134,6 +131,7 @@ class ShaderEditorPlugin : public EditorPlugin { OBJ_TYPE( ShaderEditorPlugin, EditorPlugin ); + bool _2d; ShaderEditor *shader_editor; EditorNode *editor; public: @@ -152,7 +150,7 @@ public: virtual void save_external_data(); virtual void apply_changes(); - ShaderEditorPlugin(EditorNode *p_node); + ShaderEditorPlugin(EditorNode *p_node,bool p_2d); ~ShaderEditorPlugin(); }; -- cgit v1.2.3 From 7c7ab30c4ef74f3e7a90ab6d23d69d545fac7cf3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 13 Jan 2015 11:22:56 -0300 Subject: fixes --- tools/editor/io_plugins/editor_texture_import_plugin.cpp | 6 +++++- tools/editor/io_plugins/editor_texture_import_plugin.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index b855b15b39..ce376f2e7b 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -411,7 +411,11 @@ void EditorTextureImportDialog::popup_import(const String& p_from) { Ref rimd = ResourceLoader::load_import_metadata(p_from); ERR_FAIL_COND(!rimd.is_valid()); - save_path->set_text(p_from.get_base_dir()); + if (plugin->get_mode()==EditorTextureImportPlugin::MODE_ATLAS) + save_path->set_text(p_from); + else + save_path->set_text(p_from.get_base_dir()); + texture_options->set_format(EditorTextureImportPlugin::ImageFormat(int(rimd->get_option("format")))); texture_options->set_flags(rimd->get_option("flags")); texture_options->set_quality(rimd->get_option("quality")); diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h index d17b3c05c2..e733a3ddf9 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.h +++ b/tools/editor/io_plugins/editor_texture_import_plugin.h @@ -98,6 +98,7 @@ public: IMAGE_FLAG_USE_ANISOTROPY=1024, //convert image to linear }; + Mode get_mode() const { return mode; } virtual String get_name() const; virtual String get_visible_name() const; virtual void import_dialog(const String& p_from=""); -- cgit v1.2.3 From b734c838db53dd97e64d2919f49477bfc1023062 Mon Sep 17 00:00:00 2001 From: Luke Picciau Date: Wed, 14 Jan 2015 12:02:55 +1030 Subject: Fixed typo in message --- tools/editor/io_plugins/editor_font_import_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index 4b3e052907..6ba5dc01f6 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -491,7 +491,7 @@ class EditorFontImportDialog : public ConfirmationDialog { Error err = plugin->import(dest->get_line_edit()->get_text(),rimd); if (err!=OK) { - error_dialog->set_text("Could't save font."); + error_dialog->set_text("Couldn't save font."); error_dialog->popup_centered(Size2(200,100)); return; } -- cgit v1.2.3 From 7b9f5e65c9ebb187cf4b7e3ca639ca256915d3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20H=C3=B6lzemer?= Date: Tue, 16 Sep 2014 02:16:26 +0200 Subject: New neutral default theme - desaturated UI elements to grey - desaturated all near-white icons to grey - changed some hardcoded colors --- tools/editor/editor_node.cpp | 6 +++--- tools/editor/icons/icon_add.png | Bin 393 -> 351 bytes tools/editor/icons/icon_animation.png | Bin 651 -> 595 bytes tools/editor/icons/icon_atlas_texture.png | Bin 458 -> 402 bytes tools/editor/icons/icon_audio_stream_gibberish.png | Bin 456 -> 406 bytes tools/editor/icons/icon_auto_play.png | Bin 217 -> 181 bytes tools/editor/icons/icon_bake.png | Bin 419 -> 374 bytes tools/editor/icons/icon_blend.png | Bin 488 -> 443 bytes tools/editor/icons/icon_bone.png | Bin 2992 -> 297 bytes tools/editor/icons/icon_bool.png | Bin 184 -> 147 bytes tools/editor/icons/icon_canvas_item.png | Bin 481 -> 434 bytes tools/editor/icons/icon_close.png | Bin 456 -> 398 bytes tools/editor/icons/icon_close_hover.png | Bin 444 -> 391 bytes tools/editor/icons/icon_connect.png | Bin 646 -> 592 bytes tools/editor/icons/icon_del.png | Bin 456 -> 398 bytes tools/editor/icons/icon_duplicate.png | Bin 363 -> 327 bytes tools/editor/icons/icon_edit.png | Bin 523 -> 475 bytes tools/editor/icons/icon_edit_key.png | Bin 534 -> 478 bytes tools/editor/icons/icon_edit_resource.png | Bin 286 -> 234 bytes tools/editor/icons/icon_editor_focus.png | Bin 1273 -> 1128 bytes tools/editor/icons/icon_enum.png | Bin 221 -> 193 bytes tools/editor/icons/icon_event_player.png | Bin 352 -> 299 bytes tools/editor/icons/icon_file_server.png | Bin 636 -> 563 bytes tools/editor/icons/icon_folder.png | Bin 471 -> 428 bytes tools/editor/icons/icon_font.png | Bin 282 -> 248 bytes tools/editor/icons/icon_g_d_script.png | Bin 628 -> 580 bytes tools/editor/icons/icon_group.png | Bin 402 -> 357 bytes tools/editor/icons/icon_groups.png | Bin 558 -> 507 bytes tools/editor/icons/icon_hidden.png | Bin 553 -> 500 bytes tools/editor/icons/icon_image.png | Bin 444 -> 403 bytes tools/editor/icons/icon_image_texture.png | Bin 352 -> 315 bytes tools/editor/icons/icon_instance_options.png | Bin 523 -> 483 bytes tools/editor/icons/icon_integer.png | Bin 183 -> 142 bytes tools/editor/icons/icon_interp_cubic.png | Bin 373 -> 340 bytes tools/editor/icons/icon_interp_linear.png | Bin 172 -> 134 bytes tools/editor/icons/icon_interp_raw.png | Bin 161 -> 127 bytes tools/editor/icons/icon_key.png | Bin 495 -> 450 bytes tools/editor/icons/icon_key_selected.png | Bin 257 -> 215 bytes tools/editor/icons/icon_light_map.png | Bin 441 -> 406 bytes tools/editor/icons/icon_load.png | Bin 471 -> 428 bytes tools/editor/icons/icon_lock.png | Bin 403 -> 362 bytes tools/editor/icons/icon_loop.png | Bin 408 -> 366 bytes tools/editor/icons/icon_main_play.png | Bin 367 -> 311 bytes tools/editor/icons/icon_main_stop.png | Bin 336 -> 263 bytes tools/editor/icons/icon_mirror_x.png | Bin 230 -> 187 bytes tools/editor/icons/icon_mirror_y.png | Bin 244 -> 215 bytes tools/editor/icons/icon_move_down.png | Bin 286 -> 239 bytes tools/editor/icons/icon_move_up.png | Bin 275 -> 225 bytes tools/editor/icons/icon_new.png | Bin 344 -> 298 bytes tools/editor/icons/icon_node.png | Bin 301 -> 257 bytes tools/editor/icons/icon_open.png | Bin 471 -> 428 bytes tools/editor/icons/icon_p_hash_translation.png | Bin 282 -> 234 bytes tools/editor/icons/icon_packed_scene.png | Bin 536 -> 485 bytes tools/editor/icons/icon_panels_1.png | Bin 195 -> 154 bytes tools/editor/icons/icon_panels_2.png | Bin 196 -> 157 bytes tools/editor/icons/icon_panels_3.png | Bin 205 -> 166 bytes tools/editor/icons/icon_panels_4.png | Bin 198 -> 159 bytes tools/editor/icons/icon_pin.png | Bin 420 -> 381 bytes tools/editor/icons/icon_pin_pressed.png | Bin 385 -> 346 bytes tools/editor/icons/icon_play.png | Bin 302 -> 256 bytes tools/editor/icons/icon_play_custom.png | Bin 533 -> 500 bytes tools/editor/icons/icon_play_scene.png | Bin 690 -> 600 bytes tools/editor/icons/icon_prev_scene.png | Bin 279 -> 229 bytes tools/editor/icons/icon_real.png | Bin 183 -> 146 bytes tools/editor/icons/icon_reload.png | Bin 567 -> 519 bytes tools/editor/icons/icon_remove.png | Bin 456 -> 398 bytes tools/editor/icons/icon_rename.png | Bin 320 -> 269 bytes tools/editor/icons/icon_reparent.png | Bin 523 -> 474 bytes tools/editor/icons/icon_replace.png | Bin 483 -> 435 bytes tools/editor/icons/icon_resource_preloader.png | Bin 771 -> 716 bytes tools/editor/icons/icon_sample_player.png | Bin 448 -> 415 bytes tools/editor/icons/icon_save.png | Bin 515 -> 473 bytes tools/editor/icons/icon_script.png | Bin 317 -> 272 bytes tools/editor/icons/icon_sound_room_params.png | Bin 577 -> 534 bytes tools/editor/icons/icon_stop.png | Bin 171 -> 138 bytes tools/editor/icons/icon_stream_player.png | Bin 355 -> 327 bytes tools/editor/icons/icon_string.png | Bin 156 -> 121 bytes tools/editor/icons/icon_texture.png | Bin 328 -> 292 bytes tools/editor/icons/icon_timer.png | Bin 607 -> 551 bytes tools/editor/icons/icon_tool_move.png | Bin 323 -> 275 bytes tools/editor/icons/icon_tool_pan.png | Bin 1555 -> 1654 bytes tools/editor/icons/icon_tool_rotate.png | Bin 610 -> 567 bytes tools/editor/icons/icon_tool_scale.png | Bin 415 -> 366 bytes tools/editor/icons/icon_tool_select.png | Bin 359 -> 311 bytes tools/editor/icons/icon_tools.png | Bin 639 -> 589 bytes tools/editor/icons/icon_track_continuous.png | Bin 268 -> 231 bytes tools/editor/icons/icon_track_discrete.png | Bin 153 -> 118 bytes tools/editor/icons/icon_translation.png | Bin 286 -> 241 bytes tools/editor/icons/icon_unbone.png | Bin 3000 -> 303 bytes tools/editor/icons/icon_ungroup.png | Bin 525 -> 478 bytes tools/editor/icons/icon_unlock.png | Bin 367 -> 337 bytes tools/editor/icons/icon_uv.png | Bin 381 -> 343 bytes tools/editor/icons/icon_vector.png | Bin 190 -> 158 bytes tools/editor/icons/icon_vector2.png | Bin 176 -> 141 bytes tools/editor/icons/icon_viewport.png | Bin 325 -> 287 bytes tools/editor/icons/icon_visible.png | Bin 563 -> 502 bytes tools/editor/icons/icon_zoom.png | Bin 582 -> 537 bytes 97 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index f859d19504..36b9dd3cdb 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4088,9 +4088,9 @@ EditorNode::EditorNode() { Globals::get_singleton()->set("debug/indicators_enabled",true); Globals::get_singleton()->set("render/room_cull_enabled",false); - theme->set_color("prop_category","Editor",Color::hex(0x3f3945ff)); - theme->set_color("prop_section","Editor",Color::hex(0x38323dff)); - theme->set_color("prop_subsection","Editor",Color::hex(0x342e39ff)); + theme->set_color("prop_category","Editor",Color::hex(0x454545ff)); + theme->set_color("prop_section","Editor",Color::hex(0x3d3d3dff)); + theme->set_color("prop_subsection","Editor",Color::hex(0x393939ff)); theme->set_color("fg_selected","Editor",Color::html("ffbd8e8e")); theme->set_color("fg_error","Editor",Color::html("ffbd8e8e")); diff --git a/tools/editor/icons/icon_add.png b/tools/editor/icons/icon_add.png index 1a97f356d6..26283ca67c 100644 Binary files a/tools/editor/icons/icon_add.png and b/tools/editor/icons/icon_add.png differ diff --git a/tools/editor/icons/icon_animation.png b/tools/editor/icons/icon_animation.png index 6af126bf37..ac663c0554 100644 Binary files a/tools/editor/icons/icon_animation.png and b/tools/editor/icons/icon_animation.png differ diff --git a/tools/editor/icons/icon_atlas_texture.png b/tools/editor/icons/icon_atlas_texture.png index 3da9f0bee4..0051b0cda4 100644 Binary files a/tools/editor/icons/icon_atlas_texture.png and b/tools/editor/icons/icon_atlas_texture.png differ diff --git a/tools/editor/icons/icon_audio_stream_gibberish.png b/tools/editor/icons/icon_audio_stream_gibberish.png index f10671e8a2..95470c298e 100644 Binary files a/tools/editor/icons/icon_audio_stream_gibberish.png and b/tools/editor/icons/icon_audio_stream_gibberish.png differ diff --git a/tools/editor/icons/icon_auto_play.png b/tools/editor/icons/icon_auto_play.png index e454ca8c7b..1d5c957cc7 100644 Binary files a/tools/editor/icons/icon_auto_play.png and b/tools/editor/icons/icon_auto_play.png differ diff --git a/tools/editor/icons/icon_bake.png b/tools/editor/icons/icon_bake.png index b1b0f941da..ae06ce48e6 100644 Binary files a/tools/editor/icons/icon_bake.png and b/tools/editor/icons/icon_bake.png differ diff --git a/tools/editor/icons/icon_blend.png b/tools/editor/icons/icon_blend.png index 985b63d5d1..2a75f0b2f4 100644 Binary files a/tools/editor/icons/icon_blend.png and b/tools/editor/icons/icon_blend.png differ diff --git a/tools/editor/icons/icon_bone.png b/tools/editor/icons/icon_bone.png index 174b0bc167..81b6d8856e 100644 Binary files a/tools/editor/icons/icon_bone.png and b/tools/editor/icons/icon_bone.png differ diff --git a/tools/editor/icons/icon_bool.png b/tools/editor/icons/icon_bool.png index d465b7da07..3381033b00 100644 Binary files a/tools/editor/icons/icon_bool.png and b/tools/editor/icons/icon_bool.png differ diff --git a/tools/editor/icons/icon_canvas_item.png b/tools/editor/icons/icon_canvas_item.png index 99403bed21..add54ba1af 100644 Binary files a/tools/editor/icons/icon_canvas_item.png and b/tools/editor/icons/icon_canvas_item.png differ diff --git a/tools/editor/icons/icon_close.png b/tools/editor/icons/icon_close.png index 11fa746271..10e56d5bb8 100644 Binary files a/tools/editor/icons/icon_close.png and b/tools/editor/icons/icon_close.png differ diff --git a/tools/editor/icons/icon_close_hover.png b/tools/editor/icons/icon_close_hover.png index efcc9e7471..cb519691e5 100644 Binary files a/tools/editor/icons/icon_close_hover.png and b/tools/editor/icons/icon_close_hover.png differ diff --git a/tools/editor/icons/icon_connect.png b/tools/editor/icons/icon_connect.png index 24258414c4..745e445a61 100644 Binary files a/tools/editor/icons/icon_connect.png and b/tools/editor/icons/icon_connect.png differ diff --git a/tools/editor/icons/icon_del.png b/tools/editor/icons/icon_del.png index 5349af466e..10e56d5bb8 100644 Binary files a/tools/editor/icons/icon_del.png and b/tools/editor/icons/icon_del.png differ diff --git a/tools/editor/icons/icon_duplicate.png b/tools/editor/icons/icon_duplicate.png index bae4aa2c30..f854a14fd3 100644 Binary files a/tools/editor/icons/icon_duplicate.png and b/tools/editor/icons/icon_duplicate.png differ diff --git a/tools/editor/icons/icon_edit.png b/tools/editor/icons/icon_edit.png index 012a7f5f1d..157f785b83 100644 Binary files a/tools/editor/icons/icon_edit.png and b/tools/editor/icons/icon_edit.png differ diff --git a/tools/editor/icons/icon_edit_key.png b/tools/editor/icons/icon_edit_key.png index 43a7056f38..9ab1287fc6 100644 Binary files a/tools/editor/icons/icon_edit_key.png and b/tools/editor/icons/icon_edit_key.png differ diff --git a/tools/editor/icons/icon_edit_resource.png b/tools/editor/icons/icon_edit_resource.png index de538dfe95..31d0c68fc6 100644 Binary files a/tools/editor/icons/icon_edit_resource.png and b/tools/editor/icons/icon_edit_resource.png differ diff --git a/tools/editor/icons/icon_editor_focus.png b/tools/editor/icons/icon_editor_focus.png index f21d22ebd8..72059e5053 100644 Binary files a/tools/editor/icons/icon_editor_focus.png and b/tools/editor/icons/icon_editor_focus.png differ diff --git a/tools/editor/icons/icon_enum.png b/tools/editor/icons/icon_enum.png index 2496e1d0db..ac36c96e28 100644 Binary files a/tools/editor/icons/icon_enum.png and b/tools/editor/icons/icon_enum.png differ diff --git a/tools/editor/icons/icon_event_player.png b/tools/editor/icons/icon_event_player.png index b67f91b1b3..68646b3dfe 100644 Binary files a/tools/editor/icons/icon_event_player.png and b/tools/editor/icons/icon_event_player.png differ diff --git a/tools/editor/icons/icon_file_server.png b/tools/editor/icons/icon_file_server.png index 27c99127c3..4bd94fa8c8 100644 Binary files a/tools/editor/icons/icon_file_server.png and b/tools/editor/icons/icon_file_server.png differ diff --git a/tools/editor/icons/icon_folder.png b/tools/editor/icons/icon_folder.png index 814f217edf..a450a7b297 100644 Binary files a/tools/editor/icons/icon_folder.png and b/tools/editor/icons/icon_folder.png differ diff --git a/tools/editor/icons/icon_font.png b/tools/editor/icons/icon_font.png index d9554183c2..3ffe4f1b17 100644 Binary files a/tools/editor/icons/icon_font.png and b/tools/editor/icons/icon_font.png differ diff --git a/tools/editor/icons/icon_g_d_script.png b/tools/editor/icons/icon_g_d_script.png index 3b1cc98c4d..88d865356c 100644 Binary files a/tools/editor/icons/icon_g_d_script.png and b/tools/editor/icons/icon_g_d_script.png differ diff --git a/tools/editor/icons/icon_group.png b/tools/editor/icons/icon_group.png index 577c84777e..d43b4958c9 100644 Binary files a/tools/editor/icons/icon_group.png and b/tools/editor/icons/icon_group.png differ diff --git a/tools/editor/icons/icon_groups.png b/tools/editor/icons/icon_groups.png index da4fd0d985..f4386821ed 100644 Binary files a/tools/editor/icons/icon_groups.png and b/tools/editor/icons/icon_groups.png differ diff --git a/tools/editor/icons/icon_hidden.png b/tools/editor/icons/icon_hidden.png index 45fcfc2f47..e51b9ad03a 100644 Binary files a/tools/editor/icons/icon_hidden.png and b/tools/editor/icons/icon_hidden.png differ diff --git a/tools/editor/icons/icon_image.png b/tools/editor/icons/icon_image.png index a6b1fbf6c1..5919ca8c6d 100644 Binary files a/tools/editor/icons/icon_image.png and b/tools/editor/icons/icon_image.png differ diff --git a/tools/editor/icons/icon_image_texture.png b/tools/editor/icons/icon_image_texture.png index 4618d984b8..b87e284a52 100644 Binary files a/tools/editor/icons/icon_image_texture.png and b/tools/editor/icons/icon_image_texture.png differ diff --git a/tools/editor/icons/icon_instance_options.png b/tools/editor/icons/icon_instance_options.png index 2d3e98b2ea..9108448095 100644 Binary files a/tools/editor/icons/icon_instance_options.png and b/tools/editor/icons/icon_instance_options.png differ diff --git a/tools/editor/icons/icon_integer.png b/tools/editor/icons/icon_integer.png index 0e5b5abd62..32c8d9885b 100644 Binary files a/tools/editor/icons/icon_integer.png and b/tools/editor/icons/icon_integer.png differ diff --git a/tools/editor/icons/icon_interp_cubic.png b/tools/editor/icons/icon_interp_cubic.png index ab33aa7e6a..a946d70947 100644 Binary files a/tools/editor/icons/icon_interp_cubic.png and b/tools/editor/icons/icon_interp_cubic.png differ diff --git a/tools/editor/icons/icon_interp_linear.png b/tools/editor/icons/icon_interp_linear.png index bf3849ecaf..9174af39e7 100644 Binary files a/tools/editor/icons/icon_interp_linear.png and b/tools/editor/icons/icon_interp_linear.png differ diff --git a/tools/editor/icons/icon_interp_raw.png b/tools/editor/icons/icon_interp_raw.png index 48650d6e66..f12936493b 100644 Binary files a/tools/editor/icons/icon_interp_raw.png and b/tools/editor/icons/icon_interp_raw.png differ diff --git a/tools/editor/icons/icon_key.png b/tools/editor/icons/icon_key.png index d647876866..d6096ef41f 100644 Binary files a/tools/editor/icons/icon_key.png and b/tools/editor/icons/icon_key.png differ diff --git a/tools/editor/icons/icon_key_selected.png b/tools/editor/icons/icon_key_selected.png index d916c55286..562beef98a 100644 Binary files a/tools/editor/icons/icon_key_selected.png and b/tools/editor/icons/icon_key_selected.png differ diff --git a/tools/editor/icons/icon_light_map.png b/tools/editor/icons/icon_light_map.png index 96d3f6e11c..e0333f06ea 100644 Binary files a/tools/editor/icons/icon_light_map.png and b/tools/editor/icons/icon_light_map.png differ diff --git a/tools/editor/icons/icon_load.png b/tools/editor/icons/icon_load.png index fdc06d38a3..a450a7b297 100644 Binary files a/tools/editor/icons/icon_load.png and b/tools/editor/icons/icon_load.png differ diff --git a/tools/editor/icons/icon_lock.png b/tools/editor/icons/icon_lock.png index 0cfd1d4ab1..995d87b6fb 100644 Binary files a/tools/editor/icons/icon_lock.png and b/tools/editor/icons/icon_lock.png differ diff --git a/tools/editor/icons/icon_loop.png b/tools/editor/icons/icon_loop.png index d75642359d..7bde451ca0 100644 Binary files a/tools/editor/icons/icon_loop.png and b/tools/editor/icons/icon_loop.png differ diff --git a/tools/editor/icons/icon_main_play.png b/tools/editor/icons/icon_main_play.png index 401708c49e..9e8cc6c4a9 100644 Binary files a/tools/editor/icons/icon_main_play.png and b/tools/editor/icons/icon_main_play.png differ diff --git a/tools/editor/icons/icon_main_stop.png b/tools/editor/icons/icon_main_stop.png index 3f54ba69c9..31a6cd601e 100644 Binary files a/tools/editor/icons/icon_main_stop.png and b/tools/editor/icons/icon_main_stop.png differ diff --git a/tools/editor/icons/icon_mirror_x.png b/tools/editor/icons/icon_mirror_x.png index d20f90c1da..657e7f5458 100644 Binary files a/tools/editor/icons/icon_mirror_x.png and b/tools/editor/icons/icon_mirror_x.png differ diff --git a/tools/editor/icons/icon_mirror_y.png b/tools/editor/icons/icon_mirror_y.png index 5e2f710425..111aa5e4ae 100644 Binary files a/tools/editor/icons/icon_mirror_y.png and b/tools/editor/icons/icon_mirror_y.png differ diff --git a/tools/editor/icons/icon_move_down.png b/tools/editor/icons/icon_move_down.png index ef310e80e1..06c7246084 100644 Binary files a/tools/editor/icons/icon_move_down.png and b/tools/editor/icons/icon_move_down.png differ diff --git a/tools/editor/icons/icon_move_up.png b/tools/editor/icons/icon_move_up.png index d67b1aff0b..ca6c64f7a1 100644 Binary files a/tools/editor/icons/icon_move_up.png and b/tools/editor/icons/icon_move_up.png differ diff --git a/tools/editor/icons/icon_new.png b/tools/editor/icons/icon_new.png index 3596d2e8ea..c04785fc3f 100644 Binary files a/tools/editor/icons/icon_new.png and b/tools/editor/icons/icon_new.png differ diff --git a/tools/editor/icons/icon_node.png b/tools/editor/icons/icon_node.png index b0f7fb01dc..d8ce1b7538 100644 Binary files a/tools/editor/icons/icon_node.png and b/tools/editor/icons/icon_node.png differ diff --git a/tools/editor/icons/icon_open.png b/tools/editor/icons/icon_open.png index 4fad5677ca..a450a7b297 100644 Binary files a/tools/editor/icons/icon_open.png and b/tools/editor/icons/icon_open.png differ diff --git a/tools/editor/icons/icon_p_hash_translation.png b/tools/editor/icons/icon_p_hash_translation.png index c0eadc3c55..e18ef6a76f 100644 Binary files a/tools/editor/icons/icon_p_hash_translation.png and b/tools/editor/icons/icon_p_hash_translation.png differ diff --git a/tools/editor/icons/icon_packed_scene.png b/tools/editor/icons/icon_packed_scene.png index 9c1e1c4fbf..c9802f2b66 100644 Binary files a/tools/editor/icons/icon_packed_scene.png and b/tools/editor/icons/icon_packed_scene.png differ diff --git a/tools/editor/icons/icon_panels_1.png b/tools/editor/icons/icon_panels_1.png index 501c8c9acc..546ca61c89 100644 Binary files a/tools/editor/icons/icon_panels_1.png and b/tools/editor/icons/icon_panels_1.png differ diff --git a/tools/editor/icons/icon_panels_2.png b/tools/editor/icons/icon_panels_2.png index 08f104e2b1..5a4750bda2 100644 Binary files a/tools/editor/icons/icon_panels_2.png and b/tools/editor/icons/icon_panels_2.png differ diff --git a/tools/editor/icons/icon_panels_3.png b/tools/editor/icons/icon_panels_3.png index 1d1902d8dd..13988de93a 100644 Binary files a/tools/editor/icons/icon_panels_3.png and b/tools/editor/icons/icon_panels_3.png differ diff --git a/tools/editor/icons/icon_panels_4.png b/tools/editor/icons/icon_panels_4.png index 83cc133d21..c217330d43 100644 Binary files a/tools/editor/icons/icon_panels_4.png and b/tools/editor/icons/icon_panels_4.png differ diff --git a/tools/editor/icons/icon_pin.png b/tools/editor/icons/icon_pin.png index f34c8585f7..037352137d 100644 Binary files a/tools/editor/icons/icon_pin.png and b/tools/editor/icons/icon_pin.png differ diff --git a/tools/editor/icons/icon_pin_pressed.png b/tools/editor/icons/icon_pin_pressed.png index f151b5a590..5738e6856f 100644 Binary files a/tools/editor/icons/icon_pin_pressed.png and b/tools/editor/icons/icon_pin_pressed.png differ diff --git a/tools/editor/icons/icon_play.png b/tools/editor/icons/icon_play.png index 544b3bc5f4..08cce495a9 100644 Binary files a/tools/editor/icons/icon_play.png and b/tools/editor/icons/icon_play.png differ diff --git a/tools/editor/icons/icon_play_custom.png b/tools/editor/icons/icon_play_custom.png index 5c98c7100b..8e8ab8c62a 100644 Binary files a/tools/editor/icons/icon_play_custom.png and b/tools/editor/icons/icon_play_custom.png differ diff --git a/tools/editor/icons/icon_play_scene.png b/tools/editor/icons/icon_play_scene.png index 7ca59fe900..7079cc9677 100644 Binary files a/tools/editor/icons/icon_play_scene.png and b/tools/editor/icons/icon_play_scene.png differ diff --git a/tools/editor/icons/icon_prev_scene.png b/tools/editor/icons/icon_prev_scene.png index c7c180e1c4..9d8dda5180 100644 Binary files a/tools/editor/icons/icon_prev_scene.png and b/tools/editor/icons/icon_prev_scene.png differ diff --git a/tools/editor/icons/icon_real.png b/tools/editor/icons/icon_real.png index bfe5038319..80fbf7017c 100644 Binary files a/tools/editor/icons/icon_real.png and b/tools/editor/icons/icon_real.png differ diff --git a/tools/editor/icons/icon_reload.png b/tools/editor/icons/icon_reload.png index 07f53efb56..f7c6530d77 100644 Binary files a/tools/editor/icons/icon_reload.png and b/tools/editor/icons/icon_reload.png differ diff --git a/tools/editor/icons/icon_remove.png b/tools/editor/icons/icon_remove.png index 5349af466e..10e56d5bb8 100644 Binary files a/tools/editor/icons/icon_remove.png and b/tools/editor/icons/icon_remove.png differ diff --git a/tools/editor/icons/icon_rename.png b/tools/editor/icons/icon_rename.png index f88da39915..7b6a10df93 100644 Binary files a/tools/editor/icons/icon_rename.png and b/tools/editor/icons/icon_rename.png differ diff --git a/tools/editor/icons/icon_reparent.png b/tools/editor/icons/icon_reparent.png index af85b17ecc..59aee5e42d 100644 Binary files a/tools/editor/icons/icon_reparent.png and b/tools/editor/icons/icon_reparent.png differ diff --git a/tools/editor/icons/icon_replace.png b/tools/editor/icons/icon_replace.png index 2ae843ae10..662a58dc93 100644 Binary files a/tools/editor/icons/icon_replace.png and b/tools/editor/icons/icon_replace.png differ diff --git a/tools/editor/icons/icon_resource_preloader.png b/tools/editor/icons/icon_resource_preloader.png index e31e5a0d59..14b8c4de3c 100644 Binary files a/tools/editor/icons/icon_resource_preloader.png and b/tools/editor/icons/icon_resource_preloader.png differ diff --git a/tools/editor/icons/icon_sample_player.png b/tools/editor/icons/icon_sample_player.png index 5561769b05..92d9cc77bf 100644 Binary files a/tools/editor/icons/icon_sample_player.png and b/tools/editor/icons/icon_sample_player.png differ diff --git a/tools/editor/icons/icon_save.png b/tools/editor/icons/icon_save.png index dce274ffb1..ddef66688d 100644 Binary files a/tools/editor/icons/icon_save.png and b/tools/editor/icons/icon_save.png differ diff --git a/tools/editor/icons/icon_script.png b/tools/editor/icons/icon_script.png index 65fb3c4934..baf5927c18 100644 Binary files a/tools/editor/icons/icon_script.png and b/tools/editor/icons/icon_script.png differ diff --git a/tools/editor/icons/icon_sound_room_params.png b/tools/editor/icons/icon_sound_room_params.png index 8e381d7978..2d37a4b49f 100644 Binary files a/tools/editor/icons/icon_sound_room_params.png and b/tools/editor/icons/icon_sound_room_params.png differ diff --git a/tools/editor/icons/icon_stop.png b/tools/editor/icons/icon_stop.png index 3b7562fa4a..fd568b61a8 100644 Binary files a/tools/editor/icons/icon_stop.png and b/tools/editor/icons/icon_stop.png differ diff --git a/tools/editor/icons/icon_stream_player.png b/tools/editor/icons/icon_stream_player.png index 2670a567e8..cf8fdcbaea 100644 Binary files a/tools/editor/icons/icon_stream_player.png and b/tools/editor/icons/icon_stream_player.png differ diff --git a/tools/editor/icons/icon_string.png b/tools/editor/icons/icon_string.png index 86cc8e633f..48bf753c40 100644 Binary files a/tools/editor/icons/icon_string.png and b/tools/editor/icons/icon_string.png differ diff --git a/tools/editor/icons/icon_texture.png b/tools/editor/icons/icon_texture.png index 03d6ac7db2..bbcc54bd6e 100644 Binary files a/tools/editor/icons/icon_texture.png and b/tools/editor/icons/icon_texture.png differ diff --git a/tools/editor/icons/icon_timer.png b/tools/editor/icons/icon_timer.png index 3855683033..e8c36ae893 100644 Binary files a/tools/editor/icons/icon_timer.png and b/tools/editor/icons/icon_timer.png differ diff --git a/tools/editor/icons/icon_tool_move.png b/tools/editor/icons/icon_tool_move.png index fc611cdbb1..7257d3897b 100644 Binary files a/tools/editor/icons/icon_tool_move.png and b/tools/editor/icons/icon_tool_move.png differ diff --git a/tools/editor/icons/icon_tool_pan.png b/tools/editor/icons/icon_tool_pan.png index 5c078a7b1c..bfe6fddf45 100644 Binary files a/tools/editor/icons/icon_tool_pan.png and b/tools/editor/icons/icon_tool_pan.png differ diff --git a/tools/editor/icons/icon_tool_rotate.png b/tools/editor/icons/icon_tool_rotate.png index c833b93d6e..9575ceb54e 100644 Binary files a/tools/editor/icons/icon_tool_rotate.png and b/tools/editor/icons/icon_tool_rotate.png differ diff --git a/tools/editor/icons/icon_tool_scale.png b/tools/editor/icons/icon_tool_scale.png index 3eaeae1e99..a94a6e7c98 100644 Binary files a/tools/editor/icons/icon_tool_scale.png and b/tools/editor/icons/icon_tool_scale.png differ diff --git a/tools/editor/icons/icon_tool_select.png b/tools/editor/icons/icon_tool_select.png index eb5ff6e1da..47683228e9 100644 Binary files a/tools/editor/icons/icon_tool_select.png and b/tools/editor/icons/icon_tool_select.png differ diff --git a/tools/editor/icons/icon_tools.png b/tools/editor/icons/icon_tools.png index 927173ea0f..f02d924203 100644 Binary files a/tools/editor/icons/icon_tools.png and b/tools/editor/icons/icon_tools.png differ diff --git a/tools/editor/icons/icon_track_continuous.png b/tools/editor/icons/icon_track_continuous.png index 97e8762299..9f99891c21 100644 Binary files a/tools/editor/icons/icon_track_continuous.png and b/tools/editor/icons/icon_track_continuous.png differ diff --git a/tools/editor/icons/icon_track_discrete.png b/tools/editor/icons/icon_track_discrete.png index 57a4cd5579..4e65e49afb 100644 Binary files a/tools/editor/icons/icon_track_discrete.png and b/tools/editor/icons/icon_track_discrete.png differ diff --git a/tools/editor/icons/icon_translation.png b/tools/editor/icons/icon_translation.png index 6211ab9a1b..917c6f548a 100644 Binary files a/tools/editor/icons/icon_translation.png and b/tools/editor/icons/icon_translation.png differ diff --git a/tools/editor/icons/icon_unbone.png b/tools/editor/icons/icon_unbone.png index 819e8a8e5d..c8cd774460 100644 Binary files a/tools/editor/icons/icon_unbone.png and b/tools/editor/icons/icon_unbone.png differ diff --git a/tools/editor/icons/icon_ungroup.png b/tools/editor/icons/icon_ungroup.png index 16511e3f1c..4ea620bf96 100644 Binary files a/tools/editor/icons/icon_ungroup.png and b/tools/editor/icons/icon_ungroup.png differ diff --git a/tools/editor/icons/icon_unlock.png b/tools/editor/icons/icon_unlock.png index b86447bf7a..f9fa31c3e0 100644 Binary files a/tools/editor/icons/icon_unlock.png and b/tools/editor/icons/icon_unlock.png differ diff --git a/tools/editor/icons/icon_uv.png b/tools/editor/icons/icon_uv.png index 4d9d198d86..39bc737a37 100644 Binary files a/tools/editor/icons/icon_uv.png and b/tools/editor/icons/icon_uv.png differ diff --git a/tools/editor/icons/icon_vector.png b/tools/editor/icons/icon_vector.png index 7826d7f7a9..0ee33ba0b7 100644 Binary files a/tools/editor/icons/icon_vector.png and b/tools/editor/icons/icon_vector.png differ diff --git a/tools/editor/icons/icon_vector2.png b/tools/editor/icons/icon_vector2.png index 44e48c36c7..5920109a55 100644 Binary files a/tools/editor/icons/icon_vector2.png and b/tools/editor/icons/icon_vector2.png differ diff --git a/tools/editor/icons/icon_viewport.png b/tools/editor/icons/icon_viewport.png index 0a0d93cf4d..3859f6c7e9 100644 Binary files a/tools/editor/icons/icon_viewport.png and b/tools/editor/icons/icon_viewport.png differ diff --git a/tools/editor/icons/icon_visible.png b/tools/editor/icons/icon_visible.png index 519898bbef..cbc44c4e30 100644 Binary files a/tools/editor/icons/icon_visible.png and b/tools/editor/icons/icon_visible.png differ diff --git a/tools/editor/icons/icon_zoom.png b/tools/editor/icons/icon_zoom.png index cbacaaaeca..e4bbbfe7c3 100644 Binary files a/tools/editor/icons/icon_zoom.png and b/tools/editor/icons/icon_zoom.png differ -- cgit v1.2.3 From ae7010888363d6fb9648ef069264328b78ae9047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20H=C3=B6lzemer?= Date: Thu, 18 Sep 2014 03:11:49 +0200 Subject: New iteration of the theme - try to implement ndee's mockup from the forum - new color palette - get rid of most gradients probably needs some more tweaks --- tools/editor/editor_node.cpp | 6 +++--- tools/editor/icons/icon_editor_focus.png | Bin 1128 -> 629 bytes 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 36b9dd3cdb..005bb0958f 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4088,9 +4088,9 @@ EditorNode::EditorNode() { Globals::get_singleton()->set("debug/indicators_enabled",true); Globals::get_singleton()->set("render/room_cull_enabled",false); - theme->set_color("prop_category","Editor",Color::hex(0x454545ff)); - theme->set_color("prop_section","Editor",Color::hex(0x3d3d3dff)); - theme->set_color("prop_subsection","Editor",Color::hex(0x393939ff)); + theme->set_color("prop_category","Editor",Color::hex(0x403d41ff)); + theme->set_color("prop_section","Editor",Color::hex(0x383539ff)); + theme->set_color("prop_subsection","Editor",Color::hex(0x343135ff)); theme->set_color("fg_selected","Editor",Color::html("ffbd8e8e")); theme->set_color("fg_error","Editor",Color::html("ffbd8e8e")); diff --git a/tools/editor/icons/icon_editor_focus.png b/tools/editor/icons/icon_editor_focus.png index 72059e5053..40ce11f381 100644 Binary files a/tools/editor/icons/icon_editor_focus.png and b/tools/editor/icons/icon_editor_focus.png differ -- cgit v1.2.3 From 6983cb80eab6631e99e5a4cf7224b802a4e131b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20H=C3=B6lzemer?= Date: Sun, 21 Sep 2014 15:03:31 +0200 Subject: More desaturated icons --- tools/editor/icons/icon_collapse.png | Bin 343 -> 351 bytes tools/editor/icons/icon_collapse_hl.png | Bin 341 -> 338 bytes tools/editor/icons/icon_move_down_hl.png | Bin 266 -> 234 bytes tools/editor/icons/icon_move_up_hl.png | Bin 278 -> 224 bytes 4 files changed, 0 insertions(+), 0 deletions(-) (limited to 'tools') diff --git a/tools/editor/icons/icon_collapse.png b/tools/editor/icons/icon_collapse.png index bd5c9765a5..23db9e42a7 100644 Binary files a/tools/editor/icons/icon_collapse.png and b/tools/editor/icons/icon_collapse.png differ diff --git a/tools/editor/icons/icon_collapse_hl.png b/tools/editor/icons/icon_collapse_hl.png index 7ed9a5c125..0dfbc8b175 100644 Binary files a/tools/editor/icons/icon_collapse_hl.png and b/tools/editor/icons/icon_collapse_hl.png differ diff --git a/tools/editor/icons/icon_move_down_hl.png b/tools/editor/icons/icon_move_down_hl.png index dec56e8da8..f9de58a940 100644 Binary files a/tools/editor/icons/icon_move_down_hl.png and b/tools/editor/icons/icon_move_down_hl.png differ diff --git a/tools/editor/icons/icon_move_up_hl.png b/tools/editor/icons/icon_move_up_hl.png index 19ce8bbe27..e076c9a265 100644 Binary files a/tools/editor/icons/icon_move_up_hl.png and b/tools/editor/icons/icon_move_up_hl.png differ -- cgit v1.2.3 From d2a0f86d9fd7c3795af397a0a6ad878f67c35bdd Mon Sep 17 00:00:00 2001 From: marynate Date: Thu, 15 Jan 2015 15:54:31 +0800 Subject: Only show Close Tab confirmation when script has unsaved change;Update Close Tab message to emphasize the fact script will be saved when closing tab;Stop dumping 'applying code' message to console --- tools/editor/plugins/script_editor_plugin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 55957887dc..4625569902 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -188,7 +188,7 @@ void ScriptTextEditor::apply_code() { if (script.is_null()) return; - print_line("applying code"); +// print_line("applying code"); script->set_source_code(get_text_edit()->get_text()); script->update_exports(); } @@ -1033,9 +1033,12 @@ void ScriptEditor::_menu_option(int p_option) { editor->emit_signal("request_help", text); } break; case WINDOW_CLOSE: { - - erase_tab_confirm->set_text("Close Tab?:\n\""+current->get_name()+"\""); - erase_tab_confirm->popup_centered(Point2(250,80)); + if (current->get_text_edit()->get_version()!=current->get_text_edit()->get_saved_version()) { + erase_tab_confirm->set_text("Close and save changes?\n\""+current->get_name()+"\""); + erase_tab_confirm->popup_centered(Point2(250,80)); + } else { + _close_current_tab(); + } } break; case WINDOW_MOVE_LEFT: { -- cgit v1.2.3 From d0055a751bc425b27c1e442c0e83cb618f8eca16 Mon Sep 17 00:00:00 2001 From: marynate Date: Sat, 27 Dec 2014 10:28:16 +0800 Subject: Add current_line_color ediotr setting for script and shader editor --- tools/editor/editor_settings.cpp | 1 + tools/editor/plugins/script_editor_plugin.cpp | 1 + tools/editor/plugins/shader_editor_plugin.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'tools') diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index bc800d7e9e..59e06d1e69 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -404,6 +404,7 @@ void EditorSettings::_load_defaults() { set("text_editor/symbol_color",Color::html("badfff")); set("text_editor/selection_color",Color::html("7b5dbe")); set("text_editor/brace_mismatch_color",Color(1,0.2,0.2)); + set("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15)); set("text_editor/idle_parse_delay",2); set("text_editor/create_signal_callbacks",true); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index 55957887dc..29f25e9175 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -210,6 +210,7 @@ void ScriptTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1))); get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1))); get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2))); + get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15))); Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2)); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 0349964310..81b5cd8f78 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -81,6 +81,7 @@ void ShaderTextEditor::_load_theme_settings() { get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1))); get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1))); get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2))); + get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15))); Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2)); -- cgit v1.2.3 From 904770fb91a10f826160a7e00339a1d01cbdff99 Mon Sep 17 00:00:00 2001 From: Andreas Esau Date: Thu, 15 Jan 2015 22:22:12 +0100 Subject: Export Manager Fixes - fixed a bug where it could happen that objects did not get exported - fixed some script errors - added the feature to export particle dupliobjects. Now you can add objects with the particle system and get them directly exported. --- tools/export/blender25/godot_export_manager.py | 65 ++++++++++++++++++++------ 1 file changed, 50 insertions(+), 15 deletions(-) (limited to 'tools') diff --git a/tools/export/blender25/godot_export_manager.py b/tools/export/blender25/godot_export_manager.py index a5df60e47d..31db2c9e94 100644 --- a/tools/export/blender25/godot_export_manager.py +++ b/tools/export/blender25/godot_export_manager.py @@ -101,6 +101,7 @@ class godot_export_manager(bpy.types.Panel): row = layout.row() col = row.column() + col.prop(group,"use_include_particle_duplicates") col.prop(group,"use_mesh_modifiers") col.prop(group,"use_tangent_arrays") col.prop(group,"use_triangles") @@ -134,6 +135,8 @@ class add_objects_to_group(bpy.types.Operator): bl_label = "Add Objects to Group" bl_description = "Adds the selected Objects to the active group below." + undo = BoolProperty(default=True) + def execute(self,context): scene = context.scene @@ -150,7 +153,8 @@ class add_objects_to_group(bpy.types.Operator): self.report({'INFO'}, objects_str + " added to group." ) - bpy.ops.ed.undo_push(message="Objects added to group") + if self.undo: + bpy.ops.ed.undo_push(message="Objects added to group") else: self.report({'WARNING'}, "Create a group first." ) return{'FINISHED'} @@ -228,11 +232,11 @@ class export_all_groups(bpy.types.Operator): def execute(self,context): scene = context.scene - for i in range(len(scene.godot_export_groups)): - if scene.godot_export_groups[i].active: - bpy.ops.scene.godot_export_group(idx=i) + + for i in range(0,len(scene.godot_export_groups)): + bpy.ops.scene.godot_export_group(idx=i,export_all=True) + self.report({'INFO'}, "All Groups exported." ) - bpy.ops.ed.undo_push(message="Export all Groups") return{'FINISHED'} @@ -242,6 +246,8 @@ class export_group(bpy.types.Operator): bl_description = "Exports the active group to destination folder as Collada file." idx = IntProperty(default=0) + export_all = BoolProperty(default=False) + def copy_object_recursive(self,ob,parent,single_user = True): new_ob = bpy.data.objects[ob.name].copy() @@ -280,9 +286,20 @@ class export_group(bpy.types.Operator): self.delete_object(group) def execute(self,context): + scene = context.scene group = context.scene.godot_export_groups + if not group[self.idx].active and self.export_all: + return{'FINISHED'} + + for i,object in enumerate(group[self.idx].nodes): + if object.name in bpy.data.objects: + pass + else: + group[self.idx].nodes.remove(i) + bpy.ops.ed.undo_push(message="Clear not existent Group Nodes.") + path = group[self.idx].export_path if (path.find("//")==0 or path.find("\\\\")==0): #if relative, convert to absolute @@ -307,25 +324,42 @@ class export_group(bpy.types.Operator): object.select = False context.scene.objects.active = None - for i,object in enumerate(group[self.idx].nodes): - - if object.name in bpy.data.objects: - if bpy.data.objects[object.name].type == "EMPTY": - self.convert_group_to_node(bpy.data.objects[object.name]) - else: + ### make particle duplicates, parent and select them + nodes_to_be_added = [] + if group[self.idx].use_include_particle_duplicates: + for i,object in enumerate(group[self.idx].nodes): + if bpy.data.objects[object.name].type != "EMPTY": + context.scene.objects.active = bpy.data.objects[object.name] bpy.data.objects[object.name].select = True + bpy.ops.object.duplicates_make_real() + for object in context.selected_objects: + nodes_to_be_added.append(object) + bpy.ops.object.parent_set(type="OBJECT", keep_transform=False) - else: # if object is not in the scene anymore it will be removed from the group - group[self.idx].nodes.remove(i) + for object in context.selected_objects: + object.select = False + bpy.data.objects[object.name].select = False + context.scene.objects.active = None + for object in nodes_to_be_added: + object.select = True + + ### select all other nodes from the group + for i,object in enumerate(group[self.idx].nodes): + if bpy.data.objects[object.name].type == "EMPTY": + self.convert_group_to_node(bpy.data.objects[object.name]) + else: + bpy.data.objects[object.name].select = True + bpy.ops.object.transform_apply(location=group[self.idx].apply_loc, rotation=group[self.idx].apply_rot, scale=group[self.idx].apply_scale) bpy.ops.export_scene.dae(check_existing=True, filepath=path, filter_glob="*.dae", object_types=group[self.idx].object_types, use_export_selected=group[self.idx].use_export_selected, use_mesh_modifiers=group[self.idx].use_mesh_modifiers, use_tangent_arrays=group[self.idx].use_tangent_arrays, use_triangles=group[self.idx].use_triangles, use_copy_images=group[self.idx].use_copy_images, use_active_layers=group[self.idx].use_active_layers, use_exclude_ctrl_bones=group[self.idx].use_exclude_ctrl_bones, use_anim=group[self.idx].use_anim, use_anim_action_all=group[self.idx].use_anim_action_all, use_anim_skip_noexp=group[self.idx].use_anim_skip_noexp, use_anim_optimize=group[self.idx].use_anim_optimize, anim_optimize_precision=group[self.idx].anim_optimize_precision, use_metadata=group[self.idx].use_metadata) - self.report({'INFO'}, '"'+group[self.idx].name+'"' + " Group exported." ) msg = "Export Group "+group[self.idx].name + bpy.ops.ed.undo_push(message="") bpy.ops.ed.undo() bpy.ops.ed.undo_push(message=msg) + else: self.report({'INFO'}, "Define Export Name and Export Path." ) return{'FINISHED'} @@ -397,6 +431,7 @@ class godot_export_groups(bpy.types.PropertyGroup): anim_optimize_precision = FloatProperty(name="Precision",description=("Tolerence for comparing double keyframes (higher for greater accuracy)"),min=1, max=16,soft_min=1, soft_max=16,default=6.0) use_metadata = BoolProperty(name="Use Metadata",default=True,options={'HIDDEN'}) + use_include_particle_duplicates = BoolProperty(name="Include Particle Duplicates",default=True) def register(): bpy.utils.register_class(godot_export_manager) @@ -426,7 +461,7 @@ def unregister(): bpy.utils.unregister_class(export_group) bpy.utils.unregister_class(add_objects_to_group) bpy.utils.unregister_class(del_objects_from_group) - bpy.utils.unlregister_class(select_group_objects) + bpy.utils.unregister_class(select_group_objects) bpy.utils.unregister_class(UI_List_Godot) @persistent -- cgit v1.2.3 From 9bfb08830b50af8bb06941e1e5bf07f503e9851f Mon Sep 17 00:00:00 2001 From: Carl Olsson Date: Sat, 17 Jan 2015 16:48:21 +1000 Subject: Wrapped duplicated CellOp generation code in a function and added TileMap tile picking with Ctrl+LMB. --- tools/editor/plugins/tile_map_editor_plugin.cpp | 79 +++++++++++++------------ tools/editor/plugins/tile_map_editor_plugin.h | 6 +- 2 files changed, 46 insertions(+), 39 deletions(-) (limited to 'tools') diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index a7e6a0d1f9..ce5ea58124 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -73,6 +73,18 @@ int TileMapEditor::get_selected_tile() const { return item->get_metadata(0); } +void TileMapEditor::set_selected_tile(int p_tile) { + TreeItem *item = palette->get_root()->get_children(); + while (item) { + if ((int)item->get_metadata(0) == p_tile) { + item->select(0); + palette->ensure_cursor_is_visible(); + break; + } + item = item->get_next(); + } +} + void TileMapEditor::_set_cell(const Point2i& p_pos,int p_value,bool p_flip_h, bool p_flip_v,bool p_with_undo) { ERR_FAIL_COND(!node); @@ -224,28 +236,25 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { canvas_item_editor->update(); return true; + } else if (mb.mod.control) { + tool=TOOL_PICKING; + set_selected_tile(node->get_cell(over_tile.x, over_tile.y)); + canvas_item_editor->update(); + return true; } else { int id = get_selected_tile(); if (id!=TileMap::INVALID_CELL) { tool=TOOL_PAINTING; Point2i local =node->world_to_map((xform_inv.xform(Point2(mb.x,mb.y)))); paint_undo.clear(); - CellOp op; - op.idx = node->get_cell(local.x,local.y); - if (op.idx>=0) { - if (node->is_cell_x_flipped(local.x,local.y)) - op.xf=true; - if (node->is_cell_y_flipped(local.x,local.y)) - op.yf=true; - } - paint_undo[local]=op; + paint_undo[local]=_get_op_from_cell(local); node->set_cell(local.x,local.y,id,mirror_x->is_pressed(),mirror_y->is_pressed()); return true; } } } else { - if (tool==TOOL_PAINTING || tool == TOOL_SELECTING) { + if (tool==TOOL_PAINTING || tool == TOOL_SELECTING || tool == TOOL_PICKING) { if (tool==TOOL_PAINTING) { @@ -279,15 +288,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { tool=TOOL_ERASING; Point2i local =node->world_to_map(xform_inv.xform(Point2(mb.x,mb.y))); paint_undo.clear(); - CellOp op; - op.idx = node->get_cell(local.x,local.y); - if (op.idx>=0) { - if (node->is_cell_x_flipped(local.x,local.y)) - op.xf=true; - if (node->is_cell_y_flipped(local.x,local.y)) - op.yf=true; - } - paint_undo[local]=op; + paint_undo[local]=_get_op_from_cell(local); //node->set_cell(local.x,local.y,id,mirror_x->is_pressed(),mirror_y->is_pressed()); //return true; _set_cell(local,TileMap::INVALID_CELL); @@ -337,15 +338,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { if (!paint_undo.has(over_tile)) { - CellOp op; - op.idx = node->get_cell(over_tile.x,over_tile.y); - if (op.idx>=0) { - if (node->is_cell_x_flipped(over_tile.x,over_tile.y)) - op.xf=true; - if (node->is_cell_y_flipped(over_tile.x,over_tile.y)) - op.yf=true; - } - paint_undo[over_tile]=op; + paint_undo[over_tile]=_get_op_from_cell(over_tile); } node->set_cell(over_tile.x,over_tile.y,id,mirror_x->is_pressed(),mirror_y->is_pressed()); @@ -374,25 +367,22 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { return true; } + if (tool==TOOL_ERASING) { Point2i local =over_tile; if (!paint_undo.has(over_tile)) { - - CellOp op; - op.idx = node->get_cell(over_tile.x,over_tile.y); - if (op.idx>=0) { - if (node->is_cell_x_flipped(over_tile.x,over_tile.y)) - op.xf=true; - if (node->is_cell_y_flipped(over_tile.x,over_tile.y)) - op.yf=true; - } - paint_undo[over_tile]=op; + paint_undo[over_tile]=_get_op_from_cell(over_tile); } //node->set_cell(over_tile.x,over_tile.y,id,mirror_x->is_pressed(),mirror_y->is_pressed()); _set_cell(local,TileMap::INVALID_CELL); return true; } + if (tool==TOOL_PICKING) { + set_selected_tile(node->get_cell(over_tile.x, over_tile.y)); + canvas_item_editor->update(); + return true; + } } break; case InputEvent::KEY: { @@ -710,6 +700,19 @@ void TileMapEditor::_bind_methods() { } +TileMapEditor::CellOp TileMapEditor::_get_op_from_cell(const Point2i& p_pos) +{ + CellOp op; + op.idx = node->get_cell(p_pos.x,p_pos.y); + if (op.idx>=0) { + if (node->is_cell_x_flipped(p_pos.x,p_pos.y)) + op.xf=true; + if (node->is_cell_y_flipped(p_pos.x,p_pos.y)) + op.yf=true; + } + return op; +} + TileMapEditor::TileMapEditor(EditorNode *p_editor) { node=NULL; diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h index ef869591bd..f3c590e228 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.h +++ b/tools/editor/plugins/tile_map_editor_plugin.h @@ -51,7 +51,8 @@ class TileMapEditor : public VBoxContainer { TOOL_PAINTING, TOOL_SELECTING, TOOL_ERASING, - TOOL_DUPLICATING + TOOL_DUPLICATING, + TOOL_PICKING }; Tool tool; @@ -81,11 +82,13 @@ class TileMapEditor : public VBoxContainer { bool xf; bool yf; CellOp() { idx=-1; xf=false; yf=false; } + CellOp(const CellOp& p_other) : idx(p_other.idx), xf(p_other.xf), yf(p_other.yf) {} }; Map paint_undo; int get_selected_tile() const; + void set_selected_tile(int p_tile); void _update_palette(); void _canvas_draw(); @@ -102,6 +105,7 @@ protected: void _notification(int p_what); void _node_removed(Node *p_node); static void _bind_methods(); + CellOp _get_op_from_cell(const Point2i& p_pos); public: HBoxContainer *get_canvas_item_editor_hb() const { return canvas_item_editor_hb; } -- cgit v1.2.3 From 6f3c09047ecea651a219c36dd9fa9f96b5f06be4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 18 Jan 2015 09:51:11 -0300 Subject: -intentional breakage of shader graph to fix issues, existing graphs will be broken, sorry :( --- tools/editor/plugins/script_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index d90597ddfb..4b7d1cf0e0 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -1607,7 +1607,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { edit_menu->get_popup()->add_item("Clone Down",EDIT_CLONE_DOWN,KEY_MASK_CMD|KEY_B); edit_menu->get_popup()->add_separator(); #ifdef OSX_ENABLED - edit_menu->get_popup()->add_item("Complete Symbol",EDIT_COMPLETE,KEY_MASK_META|KEY_SPACE); + edit_menu->get_popup()->add_item("Complete Symbol",EDIT_COMPLETE,KEY_MASK_CTRL|KEY_SPACE); #else edit_menu->get_popup()->add_item("Complete Symbol",EDIT_COMPLETE,KEY_MASK_CMD|KEY_SPACE); #endif -- cgit v1.2.3 From a0511ed59a0e03232bf3abb49b3c916591453aef Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 19 Jan 2015 02:39:58 -0300 Subject: Color Ramp and Curve Map added to visual shader editing. Added Color Ramp and Curve Map to shader nodes. Fixed an issue that crashed Godot Editor right when opened. --- tools/editor/icons/icon_graph_color_ramp.png | Bin 0 -> 290 bytes tools/editor/icons/icon_graph_curve_map.png | Bin 0 -> 619 bytes tools/editor/icons/icon_graph_default_texture.png | Bin 0 -> 326 bytes .../editor/plugins/shader_graph_editor_plugin.cpp | 835 ++++++++++++++++++++- tools/editor/plugins/shader_graph_editor_plugin.h | 74 +- 5 files changed, 906 insertions(+), 3 deletions(-) create mode 100644 tools/editor/icons/icon_graph_color_ramp.png create mode 100644 tools/editor/icons/icon_graph_curve_map.png create mode 100644 tools/editor/icons/icon_graph_default_texture.png (limited to 'tools') diff --git a/tools/editor/icons/icon_graph_color_ramp.png b/tools/editor/icons/icon_graph_color_ramp.png new file mode 100644 index 0000000000..9031b5ec53 Binary files /dev/null and b/tools/editor/icons/icon_graph_color_ramp.png differ diff --git a/tools/editor/icons/icon_graph_curve_map.png b/tools/editor/icons/icon_graph_curve_map.png new file mode 100644 index 0000000000..de5c32f09e Binary files /dev/null and b/tools/editor/icons/icon_graph_curve_map.png differ diff --git a/tools/editor/icons/icon_graph_default_texture.png b/tools/editor/icons/icon_graph_default_texture.png new file mode 100644 index 0000000000..da77ec9364 Binary files /dev/null and b/tools/editor/icons/icon_graph_default_texture.png differ diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 0a206c4a45..39508464c1 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -32,6 +32,642 @@ #include "scene/gui/menu_button.h" #include "scene/gui/panel.h" #include "spatial_editor_plugin.h" +#include "os/keyboard.h" + + +void GraphColorRampEdit::_input_event(const InputEvent& p_event) { + + if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) { + + points.remove(grabbed); + grabbed=-1; + update(); + emit_signal("ramp_changed"); + accept_event(); + } + + if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && p_event.mouse_button.pressed) { + + update(); + int x = p_event.mouse_button.x; + int total_w = get_size().width-get_size().height-3; + if (x>total_w+3) { + + if (grabbed==-1) + return; + Size2 ms = Size2(350, picker->get_combined_minimum_size().height+10); + picker->set_color(points[grabbed].color); + popup->set_pos(get_global_pos()-Size2(0,ms.height)); + popup->set_size(ms); + popup->popup(); + return; + } + + + float ofs = CLAMP(x/float(total_w),0,1); + + grabbed=-1; + grabbing=true; + int pos=-1; + for(int i=0;iconnect("color_changed",this,"_color_changed"); + } + if (p_what==NOTIFICATION_DRAW) { + + + Point prev; + prev.offset=0; + prev.color=Color(0,0,0); + int w = get_size().x; + int h = get_size().y; + + int total_w = get_size().width-get_size().height-3; + + for(int i=-1;i points; + Vector colors; + points.push_back(Vector2(prev.offset*total_w,h)); + points.push_back(Vector2(prev.offset*total_w,0)); + points.push_back(Vector2(next.offset*total_w,0)); + points.push_back(Vector2(next.offset*total_w,h)); + colors.push_back(prev.color); + colors.push_back(prev.color); + colors.push_back(next.color); + colors.push_back(next.color); + draw_primitive(points,colors,Vector()); + prev=next; + } + + for(int i=0;i& p_offsets,const Vector& p_colors) { + + ERR_FAIL_COND(p_offsets.size()!=p_colors.size()); + points.clear(); + for(int i=0;i GraphColorRampEdit::get_offsets() const{ + Vector ret; + for(int i=0;i GraphColorRampEdit::get_colors() const{ + + Vector ret; + for(int i=0;iadd_child(picker); + popup->set_child_rect(picker); + add_child(popup); + +} +//////////// + +void GraphCurveMapEdit::_input_event(const InputEvent& p_event) { + + if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) { + + points.remove(grabbed); + grabbed=-1; + update(); + emit_signal("curve_changed"); + accept_event(); + } + + if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && p_event.mouse_button.pressed) { + + update(); + Point2 p = Vector2(p_event.mouse_button.x,p_event.mouse_button.y)/get_size(); + p.y=1.0-p.y; + grabbed=-1; + grabbing=true; + + for(int i=0;icurve[cd->outline][lastx] = lasty; + } + else + { + cd->curve_ptr[cd->outline][lastx] = lasty; + if(gb_debug) printf("bender_plot_curve xmax:%d ymax:%d\n", (int)xmax, (int)ymax); + } +*/ + /* loop over the curve */ + for (i = 0; i < ntimes; i++) + { + /* increment the x values */ + x += dx; + dx += dx2; + dx2 += dx3; + + /* increment the y values */ + y += dy; + dy += dy2; + dy2 += dy3; + + newx = CLAMP ((Math::round (x)), 0, xmax); + newy = CLAMP ((Math::round (y)), 0, ymax); + + /* if this point is different than the last one...then draw it */ + if ((lastx != newx) || (lasty != newy)) + { +#if 0 + /* + if(fix255) + { + /* use fixed array size (for the curve graph) */ + cd->curve[cd->outline][newx] = newy; + } + else + { + /* use dynamic allocated curve_ptr (for the real curve) */ + cd->curve_ptr[cd->outline][newx] = newy; + + if(gb_debug) printf("outline: %d cX: %d cY: %d\n", (int)cd->outline, (int)newx, (int)newy); + } +#endif + draw_line(Vector2(lastx,ymax-lasty),Vector2(newx,ymax-newy),Color(0.8,0.8,0.8,0.8),2.0); + } + + lastx = newx; + lasty = newy; + } +} + + +void GraphCurveMapEdit::_notification(int p_what){ + + if (p_what==NOTIFICATION_DRAW) { + + draw_style_box(get_stylebox("bg","Tree"),Rect2(Point2(),get_size())); + + int w = get_size().x; + int h = get_size().y; + + Vector2 prev=Vector2(0,0); + Vector2 prev2=Vector2(0,0); + + for(int i=-1;i=points.size()) { + next=Vector2(1,1); + } else { + next=Vector2(points[i+1].offset,points[i+1].height); + } + + if (i+2>=points.size()) { + next2=Vector2(1,1); + } else { + next2=Vector2(points[i+2].offset,points[i+2].height); + } + + /*if (i==-1 && prev.offset==next.offset) { + prev=next; + continue; + }*/ + + _plot_curve(prev2,prev,next,next2); + + prev2=prev; + prev=next; + } + + for(int i=0;i& p_points) { + + + points.clear(); + for(int i=0;i GraphCurveMapEdit::get_points() const { + Vector ret; + for(int i=0;icast_to(); + + UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); + + + Vector offsets=cr->get_offsets(); + Vector colors=cr->get_colors(); + + DVector new_offsets; + DVector new_colors; + { + new_offsets.resize(offsets.size()); + new_colors.resize(colors.size()); + DVector::Write ow=new_offsets.write(); + DVector::Write cw=new_colors.write(); + for(int i=0;i old_offsets=graph->color_ramp_node_get_offsets(type,p_id); + DVector old_colors=graph->color_ramp_node_get_colors(type,p_id); + + if (old_offsets.size()!=new_offsets.size()) + ur->create_action("Add/Remove to Color Ramp"); + else + ur->create_action("Modify Color Ramp",true); + + ur->add_do_method(graph.ptr(),"color_ramp_node_set_ramp",type,p_id,new_colors,new_offsets); + ur->add_undo_method(graph.ptr(),"color_ramp_node_set_ramp",type,p_id,old_colors,old_offsets); + ur->add_do_method(this,"_update_graph"); + ur->add_undo_method(this,"_update_graph"); + block_update=true; + ur->commit_action(); + block_update=false; +} + +void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) { + + GraphCurveMapEdit *cr=p_curve->cast_to(); + + UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); + + + Vector points=cr->get_points(); + + DVector new_points; + { + new_points.resize(points.size()); + DVector::Write ow=new_points.write(); + for(int i=0;i old_points=graph->curve_map_node_get_points(type,p_id); + + if (old_points.size()!=new_points.size()) + ur->create_action("Add/Remove to Curve Map"); + else + ur->create_action("Modify Curve Map",true); + + ur->add_do_method(graph.ptr(),"curve_map_node_set_points",type,p_id,new_points); + ur->add_undo_method(graph.ptr(),"curve_map_node_set_points",type,p_id,old_points); + ur->add_do_method(this,"_update_graph"); + ur->add_undo_method(this,"_update_graph"); + block_update=true; + ur->commit_action(); + block_update=false; +} + void ShaderGraphView::_input_name_changed(const String& p_name, int p_id, Node *p_line_edit) { @@ -1026,6 +1740,96 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_slot(2,true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR],false,0,Color()); } break; // vec3 interpolation (with optional curve) + case ShaderGraph::NODE_COLOR_RAMP: { + + gn->set_title("ColorRamp"); + GraphColorRampEdit * ramp = memnew( GraphColorRampEdit ); + + DVector offsets = graph->color_ramp_node_get_offsets(type,p_id); + DVector colors = graph->color_ramp_node_get_colors(type,p_id); + + int oc = offsets.size(); + + if (oc) { + DVector::Read rofs = offsets.read(); + DVector::Read rcol = colors.read(); + + Vector ofsv; + Vector colorv; + for(int i=0;iset_ramp(ofsv,colorv); + + } + + ramp->connect("ramp_changed",this,"_color_ramp_changed",varray(p_id,ramp)); + ramp->set_custom_minimum_size(Size2(128,1)); + gn->add_child(ramp); + + + HBoxContainer *hbc = memnew( HBoxContainer ); + hbc->add_constant_override("separation",0); + hbc->add_child( memnew(Label("c"))); + hbc->add_spacer(); + Label *l=memnew(Label("rgb")); + l->set_align(Label::ALIGN_RIGHT); + hbc->add_child( l); + gn->add_child(hbc); + l=memnew(Label("alpha")); + l->set_align(Label::ALIGN_RIGHT); + gn->add_child( l); + + + gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); + gn->set_slot(2,false,ShaderGraph::SLOT_MAX,Color(),true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR]); + + + } break; // scalar interpolation (with optional curve) + case ShaderGraph::NODE_CURVE_MAP: { + + gn->set_title("CurveMap"); + GraphCurveMapEdit * map = memnew( GraphCurveMapEdit ); + + DVector points = graph->curve_map_node_get_points(type,p_id); + + int oc = points.size(); + + if (oc) { + DVector::Read rofs = points.read(); + + + Vector ofsv; + for(int i=0;iset_points(ofsv); + + } + map->connect("curve_changed",this,"_curve_changed",varray(p_id,map)); + + //map->connect("map_changed",this,"_curve_map_changed",varray(p_id,map)); + map->set_custom_minimum_size(Size2(128,64)); + gn->add_child(map); + + HBoxContainer *hbc = memnew( HBoxContainer ); + hbc->add_constant_override("separation",0); + hbc->add_child( memnew(Label("c"))); + hbc->add_spacer(); + Label *l=memnew(Label("cmap")); + l->set_align(Label::ALIGN_RIGHT); + hbc->add_child( l); + gn->add_child(hbc); + + + gn->set_slot(1,true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR],true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR]); + + + } break; // scalar interpolation (with optional curve) + case ShaderGraph::NODE_SCALAR_INPUT: { gn->set_title("ScalarUniform"); @@ -1173,6 +1977,28 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_slot(3,false,0,Color(),true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR]); } break; // cubemap input (assignable in material) + case ShaderGraph::NODE_DEFAULT_TEXTURE: { + + gn->set_title("CanvasItemTex"); + HBoxContainer *hbc = memnew( HBoxContainer ); + hbc->add_constant_override("separation",0); + hbc->add_child( memnew(Label("UV"))); + hbc->add_spacer(); + Label *l=memnew(Label("RGB")); + l->set_align(Label::ALIGN_RIGHT); + hbc->add_child(l); + gn->add_child(hbc); + l = memnew( Label ); + l->set_text("Alpha"); + l->set_align(Label::ALIGN_RIGHT); + gn->add_child(l); + + gn->set_slot(0,true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC],true,ShaderGraph::SLOT_TYPE_VEC,typecol[ShaderGraph::SLOT_TYPE_VEC]); + gn->set_slot(1,false,0,Color(),true,ShaderGraph::SLOT_TYPE_SCALAR,typecol[ShaderGraph::SLOT_TYPE_SCALAR]); + + + } break; // screen texture sampler (takes UV) (only usable in fragment case Shader) + case ShaderGraph::NODE_OUTPUT: { gn->set_title("Output"); @@ -1360,6 +2186,8 @@ void ShaderGraphView::_bind_methods() { ObjectTypeDB::bind_method("_variant_edited",&ShaderGraphView::_variant_edited); ObjectTypeDB::bind_method("_cube_edited",&ShaderGraphView::_cube_edited); ObjectTypeDB::bind_method("_comment_edited",&ShaderGraphView::_comment_edited); + ObjectTypeDB::bind_method("_color_ramp_changed",&ShaderGraphView::_color_ramp_changed); + ObjectTypeDB::bind_method("_curve_changed",&ShaderGraphView::_curve_changed); ObjectTypeDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated); } @@ -1455,13 +2283,16 @@ const char* ShaderGraphEditor::node_names[ShaderGraph::NODE_TYPE_MAX]={ "GraphVecsToXform:Vectors -> XForm:", // 3 vec input", 1 xform output "GraphScalarInterp:Scalar Interpolate", // scalar interpolation (with optional curve) "GraphVecInterp:Vector Interpolate:", // vec3 interpolation (with optional curve) - "GraphScalarUniform:Scalar Uniform", // scalar uniform (assignable in material) + "GraphColorRamp:Color Ramp", // vec3 interpolation (with optional curve) + "GraphCurveMap:Curve Remap:", // vec3 interpolation (with optional curve) + "GraphScalarUniform:Scalar Uniform", // scalar uniform (assignable in material) "GraphVectorUniform:Vector Uniform", // vec3 uniform (assignable in material) "GraphRgbUniform:RGB Uniform", // color uniform (assignable in material) "GraphXformUniform:XForm Uniform", // mat4 uniform (assignable in material) "GraphTextureUniform:Texture Uniform", // texture input (assignable in material) "GraphCubeUniform:CubeMap Uniform:", // cubemap input (assignable in material) - "Output", // output (shader type dependent) + "GraphDefaultTexture:CanvasItem Texture:", // cubemap input (assignable in material) + "Output", // output (shader type dependent) "GraphComment:Comment", // comment diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index bd983c59be..c6fb2f82b1 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -45,6 +45,77 @@ */ +class GraphColorRampEdit : public Control { + + OBJ_TYPE(GraphColorRampEdit,Control); + + + struct Point { + + float offset; + Color color; + bool operator<(const Point& p_ponit) const { + return offset points; + + void _color_changed(const Color& p_color); + +protected: + void _input_event(const InputEvent& p_event); + void _notification(int p_what); + static void _bind_methods(); +public: + + void set_ramp(const Vector& p_offsets,const Vector& p_colors); + Vector get_offsets() const; + Vector get_colors() const; + virtual Size2 get_minimum_size() const; + GraphColorRampEdit(); +}; + + +class GraphCurveMapEdit : public Control { + + OBJ_TYPE(GraphCurveMapEdit,Control); + + + struct Point { + + float offset; + float height; + bool operator<(const Point& p_ponit) const { + return offset points; + + void _plot_curve(const Vector2& p_a,const Vector2& p_b,const Vector2& p_c,const Vector2& p_d); +protected: + void _input_event(const InputEvent& p_event); + void _notification(int p_what); + static void _bind_methods(); +public: + + void set_points(const Vector& p_points); + Vector get_points() const; + virtual Size2 get_minimum_size() const; + GraphCurveMapEdit(); +}; + class ShaderGraphView : public Node { OBJ_TYPE(ShaderGraphView,Node); @@ -95,7 +166,8 @@ class ShaderGraphView : public Node { void _cube_edited(int p_id,Node* p_button); void _variant_edited(); void _comment_edited(int p_id,Node* p_button); - + void _color_ramp_changed(int p_id,Node* p_ramp); + void _curve_changed(int p_id,Node* p_curve); void _sg_updated(); Map node_map; protected: -- cgit v1.2.3 From 11c1756257368f3cd41702016c3303c0d22e3b59 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 20 Jan 2015 20:25:19 -0300 Subject: Visual Shader Editing for 2D Editing 2D shaders with visual editor seems to work now. --- tools/editor/editor_node.cpp | 3 ++- .../editor/plugins/shader_graph_editor_plugin.cpp | 26 +++++++++++++++++----- tools/editor/plugins/shader_graph_editor_plugin.h | 6 +++-- 3 files changed, 26 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 005bb0958f..6ff16e661c 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4035,7 +4035,8 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( ScriptEditorPlugin(this) ) ); add_editor_plugin( memnew( EditorHelpPlugin(this) ) ); add_editor_plugin( memnew( AnimationPlayerEditorPlugin(this) ) ); - add_editor_plugin( memnew( ShaderGraphEditorPlugin(this) ) ); + add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) ); + add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,false) ) ); add_editor_plugin( memnew( ShaderEditorPlugin(this,true) ) ); add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) ); add_editor_plugin( memnew( CameraEditorPlugin(this) ) ); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 39508464c1..508e8b4cba 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -33,7 +33,7 @@ #include "scene/gui/panel.h" #include "spatial_editor_plugin.h" #include "os/keyboard.h" - +#include "canvas_item_editor_plugin.h" void GraphColorRampEdit::_input_event(const InputEvent& p_event) { @@ -2234,6 +2234,9 @@ void ShaderGraphEditor::_notification(int p_what) { if (i==ShaderGraph::NODE_OUTPUT) continue; + if (!_2d && i==ShaderGraph::NODE_DEFAULT_TEXTURE) + continue; + String nn = node_names[i]; String ic = nn.get_slice(":",0); String v = nn.get_slice(":",1); @@ -2297,7 +2300,8 @@ const char* ShaderGraphEditor::node_names[ShaderGraph::NODE_TYPE_MAX]={ }; -ShaderGraphEditor::ShaderGraphEditor() { +ShaderGraphEditor::ShaderGraphEditor(bool p_2d) { + _2d=p_2d; HBoxContainer *hbc = memnew( HBoxContainer ); menu = memnew( MenuButton ); @@ -2339,7 +2343,13 @@ void ShaderGraphEditorPlugin::edit(Object *p_object) { bool ShaderGraphEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("ShaderGraph"); + ShaderGraph *shader=p_object->cast_to(); + if (!shader) + return false; + if (_2d) + return shader->get_mode()==Shader::MODE_CANVAS_ITEM; + else + return shader->get_mode()==Shader::MODE_MATERIAL; } void ShaderGraphEditorPlugin::make_visible(bool p_visible) { @@ -2353,12 +2363,16 @@ void ShaderGraphEditorPlugin::make_visible(bool p_visible) { } -ShaderGraphEditorPlugin::ShaderGraphEditorPlugin(EditorNode *p_node) { +ShaderGraphEditorPlugin::ShaderGraphEditorPlugin(EditorNode *p_node, bool p_2d) { + _2d=p_2d; editor=p_node; - shader_editor = memnew( ShaderGraphEditor ); + shader_editor = memnew( ShaderGraphEditor(p_2d) ); shader_editor->hide(); - SpatialEditor::get_singleton()->get_shader_split()->add_child(shader_editor); + if (p_2d) + CanvasItemEditor::get_singleton()->get_bottom_split()->add_child(shader_editor); + else + SpatialEditor::get_singleton()->get_shader_split()->add_child(shader_editor); // editor->get_viewport()->add_child(shader_editor); diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index c6fb2f82b1..1726302e90 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -191,6 +191,7 @@ class ShaderGraphEditor : public VBoxContainer { ShaderGraphView *graph_edits[ShaderGraph::SHADER_TYPE_MAX]; static const char* node_names[ShaderGraph::NODE_TYPE_MAX]; + bool _2d; void _add_node(int p_type); protected: void _notification(int p_what); @@ -198,13 +199,14 @@ protected: public: void edit(Ref p_shader); - ShaderGraphEditor(); + ShaderGraphEditor(bool p_2d); }; class ShaderGraphEditorPlugin : public EditorPlugin { OBJ_TYPE( ShaderGraphEditorPlugin, EditorPlugin ); + bool _2d; ShaderGraphEditor *shader_editor; EditorNode *editor; @@ -216,7 +218,7 @@ public: virtual bool handles(Object *p_node) const; virtual void make_visible(bool p_visible); - ShaderGraphEditorPlugin(EditorNode *p_node); + ShaderGraphEditorPlugin(EditorNode *p_node,bool p_2d); ~ShaderGraphEditorPlugin(); }; -- cgit v1.2.3 From c6eabbbec5a9fec7a0d473fe67a544af3454c3d2 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 21 Jan 2015 00:57:37 -0300 Subject: fixed world vertex issues in canvas item shader --- tools/editor/plugins/shader_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index 81b5cd8f78..2fcd4e8cd1 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -396,7 +396,7 @@ void ShaderEditor::edit(const Ref& p_shader) { light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT); } - vertex_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_VERTEX); + //vertex_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_VERTEX); // see if already has it -- cgit v1.2.3