Code Monkey home page Code Monkey logo

imgui-node-editor's People

Contributors

aartodding avatar georgeto avatar malikolivier avatar multipain avatar ocornut avatar syoyo avatar thedmd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imgui-node-editor's Issues

Show custom popup when drawing input pin

Since drawing combo boxes does not work in the nodes, I am trying to achieve similar behavior with popup boxes. I got the code working, however, there is an ugly graphical glitch that I cannot seem to get rid of.
I am using the blueprints example code. Here is my added code:

`
// defined somewhere at the top
enum class ImageType { Image8U, Image32U };
const ImageType types[] = {ImageType::Image8U, ImageType::Image32U};
const char* items[] = { "Image8U", "Image32U" };

enum class CustomMenuEnum
{
None = 0,
ImageType = 1
};

CustomMenuEnum CurrentMenu = CustomMenuEnum::None;

// when drawing the node input pins
for (auto& input : node.Inputs)
{
auto alpha = ImGui::GetStyle().Alpha;
if (newLinkPin && !CanCreateLink(newLinkPin, &input) && &input != newLinkPin)
alpha = alpha * (48.0f / 255.0f);

builder.Input(input.ID);
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
DrawPinIcon(input, IsPinLinked(input.ID), (int)(alpha * 255));
if (!input.Name.empty())
{
	ImGui::Spring(0);
	ImGui::TextUnformatted(input.Name.c_str());
	ImGui::Spring(0);
}
if (input.Type == PinType::ImageType)
{
	ImageType old = map_pin_image_type[input.ID]; // get current image type associated with the pin
	ImageType now = old;
	const char* current = items[0];
	switch(now)
	{
		case ImageType::Image8U: 	current = items[0]; break;
		case ImageType::Image32U: 	current = items[1]; break;
		default: break;
	}
	if (ImGui::Button(current))
	{
		CurrentMenu = CustomMenuEnum::ImageType;
		ed::Suspend();
		ImGui::OpenPopup("Image Type Menu");
		ed::Resume();
	}

	if (CurrentMenu == CustomMenuEnum::ImageType)
	{
		// show custom menu for image type
		ed::Suspend();
		if (ImGui::BeginPopup("Image Type Menu"))
		{
			for (int i = 0; i < 2; i++)
			{
				if (ImGui::MenuItem(items[i]))
				{
					now = types[i];
					break;
				}
			}

			ImGui::EndPopup();
		}
		else
		{
			CurrentMenu = CustomMenuEnum::None;
		}
		ed::Resume();
	}

	if (old != now)
	{
		// update the image type
		map_pin_image_type[input.ID] = now;
	}
}
ImGui::PopStyleVar();
builder.EndInput();

}
`
Here is how it looks by default:
Screenshot from 2019-12-25 13-27-28
And here how it looks when the popup is shown. You can see the node header text is shifted and so are various UI elements on the top left, as well as the splitter bar.
Screenshot from 2019-12-25 13-27-54

Any idea what am I doing wrong?

Broken build with gcc 7.2.0

Commit a65df7c explicitly drops support for 64-bit builds.
Is it just an experiment?
I am just curious to know why this choice was made.

If this is a hassle, please do not bother explaining the details, as this is your project after all.

EDIT 2018-05-24: This was a complete misunderstanding. 64-bit support is not dropped! See my next message for the real issue.

Nodes become inactive after scrolling (latest imgui docking branch)

Steps to reproduce:

  1. Clone imgui-node-editor
  2. Replace all *.h and *.cpp imgui files in ThirdParty/imgui directory by files from latest imgui docking branch
  3. Add all required ImGuiKey_* to enum in imgui.h
  4. Compile Examples/BasicInteraction (for example)
  5. Move one of the nodes far away from starting position
  6. If try to move it again - fail, it is now inactive

This is because the node now is out of the mouse viewport rect. If comment this line
imgui/imgui.cpp#L4675 everything works fine, but I think it's a bad idea...

If add this code before line #4675, we will be able to see that mouse viewport rect, out of which nodes become inactive

auto rect = g.MouseViewport->GetRect();
ImGui::GetWindowDrawList()->AddRect(rect.Min, rect.Max, IM_COL32(255, 0, 0, 255));

mouse-viewport-rect

Is it the right tool for a generic node editor ?

Hi,

I don't know if your library is corresponding to my needs. Maybe you can help me to decide well :)
The goal is to provide an easy way to users to design their own automatisms on embedded boards.
I already developed the embedded stuff, and compiler to provided binaries from the graphs
And now , I need to develop a specific node editor with custom nodes.
The graph could be loaded/saved as a json/xml, or whatever format (Only nodes list, connections, and positions list are saved). After that I have a compiler to produce specific binary files embedded on an embedded computer unit.
So do you think your lib is fitting well that specs ? :

Yann

Node editor on GCC

I finally had some time to start digging in the code, and as soon as I tried to compile it under Linux I noticed a couple things:

  1. Some member variables are named after their type (eg: Node* Node;) which does not play well with GCC/CLang.
  2. Usage of std::optional<>, which I love but requires C++17, which is not yet supported officially by most compiler versions (can be worked around by using std::experimental::optional<> instead).
  3. It seems like there's a decent chunk of platform-specific code in the imgui_impl_dx11.cpp file, which might be hard to port over Linux/OSX frameworks.
  4. itoa function, which is non-standard.
  5. Some template funkiness.

Point 1, 2 and 4 are easily fixed, but I would like to have your opinion about point 3. I got to the point where the simple test (application_simple.cpp) works, but got stuck after that. I was wondering if you had a rough idea of how much work it would be to change the main application code to run on glfw/SDL2, before I start banging my head at the wall 😄

Loading/Saving

Hi,

I would like to be able to save and load a complete flow to file
In the blueprint example there's some ref to the ed::Config struct that seems to allow that.
But it's only related to nodes and settings and not links ...
Some hints ?

EditorContext incomplete type error.

I tried to make a "EditorContext" instance with default initialization, which greeted me with a incomplete type error.

Is this is a bug? Are "CreateEditor", "DestroyEditor" optional or necessary to construct a "EditorContext"?
Why use raw pointers, new, delete to construct/destroy a EditorContext?

Shouldn't the library-user decide whether to store it in a raw pointer?

Strange issues with deleting links

I am having some very weird issue deleting nodes. It seems like when deleting a link, it gets the correct link ID to delete, but somehow the input and output pins associated with this link ID change. Example debug output:

New connection between 4 and 1
Internal ID's are 2147483643 and 2147483646
Link ID is: 100000
// add some other links
// then
Deletion of linkID: 100000 // <-- notice, same ID
Connection deleted between5 and 2 // <-- node ID different
Internal ID's are 2147483642 and 2147483645

Note that I create the unique NodeEditor ID for the pins by doing INT_MAX - N, and the id's for the nodes themselves by just doing N.

Vertical flow

Hello,

Related to: #49
Could you share the code (maybe as an example) this code who allows you to display this image?

I tried this:
https://pastebin.com/dmEp0D4u
Testing lot of variation by moving the spring.
Let me know If I did something wrong.

Cheers

How to change properly the flow direction?

Hello,

What is the clean way to change the flow direction.
For example: Right to Left, Top to Bottom, Bottom to Top
As an illustration:
Houdini:
http://valerioviperino.me/assets/img/articles/kinect-houdini-pcloud/delaunay_pc_graph.png
Unity (with mix of horiontal (Left_Right & Top_Down):
https://forum.unity.com/proxy.php?image=https%3A%2F%2Fi.imgur.com%2FHOq25KV.png%3F1&hash=2def92bc411d60648a04015e2422f29e

Should I override each:
virtual Draw for Node, Link, Pin? (& un-final it)

Thanks

Architecture questions

Hello thedmd,

First of all, thanks for starting this amazing project. I've been investigating the node editor solutions for a while in order to integrate into one of my projects, and I found yours and tried a little bit. Since I used ImGui previously too, I'd like to ask some questions because the state of this project now is still not easy to integrate into other projects:

  1. Would you like to separate the platform-specific impl of ImGui (rendering impl and window impl) from the Example folder? It should not be the user's obligation to fully care about how the platform-specific things done if your dependencies restricted the platform-specific impl to their design. And it's more flexible to isolate them into separate libs rather than coupling with the entry module, then it's easier to let the user use build config to choose platform and rendering backend;

  2. Would you like to use the relative path to include third-party headers in imgui_node_editor.h? As a user, I don't want to intrusively modified my build configs to fit your build configs, it's better to only have physical dependencies among headers rather than mess with makefiles;

  3. What's the future direction of this project? Would it have a self-constraint API or would it keep mixing with ImGui?

Thanks and wish you a happy new year,

I have suggestions after heard you are refactoring

Hi, first of all, nice job, and thank you for your hard work.
I personally hope that you can make your library lighter, concise and easier for others to integrate into their own projects and secondary develop. You know, there are now libraries of single-header files, and their authors are very fond of lightweight.

Document recreating the "Blueprint example" imgui dependency

In the Readme, there is a section in this location:
Dependencies > Examples dependencies > https://github.com/thedmd/imgui/tree/feature/layout (used in blueprints sample only)

I am finding that the "copy of imgui that the blueprint example depends on" is hard to track down or re-create on my own. Let me explain what I've found:

  • The "layout" branch you talk about is insufficient to compile the blueprint example with, because the blueprint example also needs the "draw list fringe scale" feature.
  • The "Combined" branch, which has the layout and fringe scale features together works pretty darn good, but has a bug...

The bug (using your combined branch as the blueprint imgui dependency) is that the background grid line thickness and icon thickness don't scale correctly when you zoom in or out.

With my project, I wanted to do some things using the Blueprint example as a base. I can use the IMGui copy you provide in the third-party directory, but this introduces a dependency on you keeping it updated, which makes me a little nervous. I would rather be able to make the dependency myself using a patching system if possible.

So for this bug resolution, I would like the readme to be updated with some instructions on creating the blueprint example imgui version that you have provided, or to let me know if "I've got it all wrong". Thanks!

Any way of making Layout Implementation a separate header?

Hello

Is there any way to make your layout feature a separate header from imgui?
For example all your changes to be transferred to a separate header/cpp file named imguiLayout so that we can update imgui easily whenever its needed.

Button on a node opens a popup

Hi @thedmd ,
I was trying to open a popup on a node via a button. I modified the Simple.cpp example with the following function:

auto& io = ImGui::GetIO();
const char* button_name = "button";
const char* popup_name = "popup";

ed::SetCurrentEditor(g_Context);
ed::Begin("My Editor", ImVec2(0.0, 0.0f));
int uniqueId = 1;
// Start drawing nodes.
ed::BeginNode(uniqueId++);
  
if (ImGui::Button(button_name)) {
  ImGui::OpenPopup(popup_name);
}
if (ImGui::BeginPopup(popup_name)) {
  ImGui::PushItemWidth(70);
  bool dummy_true = true;
  ImGui::Text("some text");
  ImGui::PopItemWidth();
  ImGui::EndPopup();
}
ed::EndNode();
ed::End();
ed::SetCurrentEditor(nullptr);

The problem is that when I scroll the main window, the popup does not update the position, thus it will appear on top of the first position of the button (I hope I was clear).
I think is something related to the drawList, but I can't figure how it should work.
Could you give me some hints?
Thank you so much!

EditorContext pointers stored in objects breaks live reloading?

Hi, I run a live reloading setup where I hotload code in from a dll after compiling it. It crashes because I suspect objects are using EditorContext pointers are no longer valid after reloading. This is the reason why imgui has ImGui::SetCurrentContext, which I call in the start of my update loop. Likewise I call ImNodeEd::SetCurrentEditor in the same manner.

So likely the solution to this is to not store EditorContext* Editor pointers in your structs like EditorAction, AnimationController, etc and call the GetEditorContext() function to ensure an up-to-date address.

Also, here's another side problem:
GetCurrentEditor() returns ax::NodeEditor::EditorContext*, while the struct EditorContext is under the ax::NodeEditor::Detail namespace.

Column problem

I found a problem.

This code causes assert in Suspend.

ImGui::Begin("Begin");
ImGui::Columns(2);
ImGui::NextColumn();

ed::SetCurrentEditor(g_Context);
ed::Begin("My Editor", ImVec2(0.0, 0.0f));

// assert!
ed::Suspend();
ed::Resume();

ed::End();
ed::SetCurrentEditor(nullptr);

ImGui::Columns(1);
mGui::End();

But this codes runs with Begin and End child.

ImGui::Begin("Begin");
ImGui::Columns(2);
ImGui::NextColumn();

// add
ImGui::BeginChild("Child");
ed::SetCurrentEditor(g_Context);
ed::Begin("My Editor", ImVec2(0.0, 0.0f));

ed::Suspend();
ed::Resume();

ed::End();
ed::SetCurrentEditor(nullptr);

// add
ImGui::EndChild();

ImGui::Columns(1);
mGui::End();

Is it a bug?

Best regards.

InputTextMultiline inside a node gets ill-positioned

Hi there!
I've been playing alot with your code lately, and I found out that adding a ImGui::InputTextMultiline() inside a Blueprint node is somewhat broken.
If one pans around or zooms, the text area does not move/does not get resized at all.
Not sure if you would be able to figure out what is going on, and if there's an easy fix for that.

Question about "simple" example

In the Simple example, is it expected that one can drag out a connection from on Out pin, and drag it to an In pin? I'm not able to left-drag a connection out of the Out. Before diving too deep into debugging, I thought I should ask this question first :)

Drag and Drop into main Window

Hi ,

I would like to have a panel on the left with the list off all nodes available , classified by type (with treenode). Then I would be able to drag and drop from the name of node into the main window to spawn a node.
So Is there a way to manage ImGui::BeginDRagDropTarget() in the main window ?
.

load/save issues

Hi,

I've been playing around with your blueprints and attempting to get the save feature to work, it manages to save out the correct json data but when I re-load it seems to overwrite everything to the original settings, not sure if I'm missing a flag somewhere or something?

Thanks in advance :)

how do you ensure overlapping nodes work correctly?

Thanks for fixing the build! I got it working on Windows :)

You've done a nice job! I really like how the pins are highlighted during a connection drag. I'm the developer of this app which is one big node editor.

I noticed that in node editor examples here (Dear IMGUI) and here (nuklear), both have trouble rendering nodes that are overlapping.

It would seem that the typical immediate mode concept would have trouble with overlapping UI widgets, because the event order would be the same as the display order. That is, widgets that are drawn first process events first as well.

Does Dear IMGUI reverse the draw order? Or did you do something special in your implementation to handle overlapping nodes? It wasn't apparent to me from looking at the code.

thanks!

running example assertion error

Running latest master on Debian Buster errors:

gdb 00-Simple 
GNU gdb (Debian 7.12-6+b2) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from 00-Simple...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/arnaud/src/imgui-node-editor/Build/Bin/00-Simple 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff0de7700 (LWP 21682)]
00-Simple: /home/arnaud/src/imgui-node-editor/NodeEditor/Source/Editor.h:69: ax::NodeEditor::NodeId ax::NodeEditor::Detail::ObjectId::AsNodeId() const: Assertion `IsNodeId()' failed.

Thread 1 "00-Simple" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6a7b231 in __GI_abort () at abort.c:79
#2  0x00007ffff6a729da in __assert_fail_base (fmt=0x7ffff6bc5d48 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x555555638f88 "IsNodeId()", 
    file=file@entry=0x555555638f40 "/home/arnaud/src/imgui-node-editor/NodeEditor/Source/Editor.h", 
    line=line@entry=69, 
    function=function@entry=0x555555639d80 <ax::NodeEditor::Detail::ObjectId::AsNodeId() const::__PRETTY_FUNCTION__> "ax::NodeEditor::NodeId ax::NodeEditor::Detail::ObjectId::AsNodeId() const") at assert.c:92
#3  0x00007ffff6a72a52 in __GI___assert_fail (assertion=0x555555638f88 "IsNodeId()", 
    file=0x555555638f40 "/home/arnaud/src/imgui-node-editor/NodeEditor/Source/Editor.h", line=69, 
    function=0x555555639d80 <ax::NodeEditor::Detail::ObjectId::AsNodeId() const::__PRETTY_FUNCTION__> "ax::NodeEditor::NodeId ax::NodeEditor::Detail::ObjectId::AsNodeId() const") at assert.c:101
#4  0x00005555555e78e1 in ax::NodeEditor::Detail::ObjectId::AsNodeId() const ()
#5  0x00005555555d4ffc in ax::NodeEditor::Detail::Settings::Parse(char const*, char const*, ax::NodeEditor::Detail::Settings&) ()
#6  0x00005555555e8378 in ax::NodeEditor::Detail::Settings::Parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ax::NodeEditor::Detail::Settings&) ()
#7  0x00005555555d0ff7 in ax::NodeEditor::Detail::EditorContext::LoadSettings() ()
#8  0x00005555555cd74d in ax::NodeEditor::Detail::EditorContext::Begin(char const*, ImVec2 const&) ()
#9  0x00005555555c6d05 in ax::NodeEditor::Begin(char const*, ImVec2 const&) ()
#10 0x000055555555b15a in Application_Frame() ()
#11 0x0000555555625be7 in main ()

Cmake did give a warning about OpenGL but I don't think it matters:

make
CMake Warning (dev) at /usr/share/cmake-3.11/Modules/FindOpenGL.cmake:270 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  Examples/Common/Application/CMakeLists.txt:14 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Problem with scalar input fieldin node

Hi,

I'm trying to use an ImGui::input int in a node but I get that :
Blueprints_d_kDurxLx2hP
I tried to force the size , but +/- seem to be on another lines
Same using InputScalar :-/

Tree node bug

Is TreeNode in Node supported?

    ed::BeginNode(uniqueId++);
        ImGui::Text("Node A");
        ed::BeginPin(uniqueId++, ed::PinKind::Input);
            ImGui::Text("-> In");
        ed::EndPin();
        ImGui::SameLine();
        ed::BeginPin(uniqueId++, ed::PinKind::Output);
            ImGui::Text("Out ->");
        ed::EndPin();

		if (ImGui::TreeNode("TreeNode"))
		{
			ImGui::TreePop();
		}

    ed::EndNode();

image

Question: Any form to save the state of the BP

Hi, first of all, nice job,
Second, is there any form to save the states of the blueprint editor? I don't know if there is, I know that is a json file to load the basic config, but, any form to override it, for example, only one bp?
I tried to add some more bp, but after close, it doesn´t load the last changes.
(PD: soz for my english )

Question : Assertion when using Blueprints example

When I copied the whole blueprints example to my project I got an assertion in imgui_widgets.cpp on line 606 size_args where size is ImVec2(8, 0)`. Is there a way to debug how big the nodes are and where they get calculated in order to debug why they are not getting the right size. In the solution prodived it works fine.

PS I am using ImGui 1.70 with docking should I maybe do something differently?

Very interested in using this for build a shader editor

Hi ,Im recently working on a shader visual tool.Find your project is very helpful,The liscense is MIT ,so I try to merge this to my exist project ,I noticed the issue with "_FringeScale",but it seems that the ImGui doesn't have some function like ImGui::Spring ImGui::BeginHorizontal.

Selection and dragging broken when node ID set to 0

Following the pattern of the "Basic Interaction" example, I created a collection of nodes with unique IDs. I have a global nextNodeId variable which starts at 1 and is incremented any time a new node is created.

However, if I start the nextNodeId at 0, several weird things happen:

  • I'm unable to click-select the node with ID 0. The only way to select it is using a box selection.
  • Once I've box-selected the node with ID 0, I'm unable to click and drag the node around. I have to move it by selecting node 0 and another node, then clicking and dragging the other node to move both.
  • If I select any node, I cannot deselect them simply by clicking on the background. To deselect the nodes, I have to do a box selection on the background.
  • I cannot select links.
  • I cannot delete nodes using the Backspace key.

As soon as I start nextNodeId at 1, all of these problems go away. I'm not sure if this intended behavior, but I haven't seen it documented anywhere so I assume it's unwanted behavior.

Infinite for loop iterating through m_PreviousPin

Hi, somehow I arrived at an infinite loop regarding iterating through previous_pin pointing to the same node.

image

image

I think the minor problem is that you didn't check if Editor->GetPin(..) returns the same node as m_LastPin.

In NodeBuilder::BeginPin(..)
Update to

if (m_CurrentPin != m_CurrentNode->m_LastPin)
      m_CurrentPin->m_PreviousPin = m_CurrentNode->m_LastPin;
m_CurrentNode->m_LastPin    = m_CurrentPin;

Unfortunately, this leaves me with me being unable to drag my first node around. I'm just using the node editor code from simple.cpp for a few basic nodes encapsulated with a ImGui::Begin() and ImGui::End(), without your modified imgui. Is there anywhere in the code I can look at to solve this?

Customization of imgui causes build error '_FringeScale': is not a member of 'ImDrawList'

I already had an official copy of the imgui library in my program and when I added imgui-node-editor, I get this build error when my codebase references the official imgui.h:

'_FringeScale': is not a member of 'ImDrawList'

The following commit added _FringeScale to ThirdParty/imgui/imgui.h:
11d2dca

However, I don't see any reference to it in the official imgui repo:
https://github.com/ocornut/imgui

This customization to imgui means I have to use your custom version of imgui throughout my codebase. Even when I built imgui-node-editor, other libraries in my codebase would reference the official imgui.h, which doesn't have _FringeScale. I suggest contributing this change and any other customizations to the imgui project and only consume them once they are merged to master.

If you really want a custom imgui, please rename the source and the public interfaces so that it can coexist with the official imgui library.

Bug: MoveOverEdge() causes Canvas view to break

If you happen to alt+tab or press the windows key while dragging is active, the program will lose focus and io.MousePos is set to ImVec2(-FLT_MAX,-FLT_MAX). This does indeed break the scroll calculation imgui_node_editor.cpp#L3090.

It can be fixed by checking if mouse position is valid:

// Mouse is over screen, do nothing
if (screenRect.Contains(screenMousePos) || !ImGui::IsMousePosValid()) return false;

macOS: examples crash on startup

Process:               00-Simple [36553]
Path:                  /Users/USER/Downloads/*/00-Simple.app/Contents/MacOS/00-Simple
Identifier:            com.sandbox.collisions
Version:               . (???)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           00-Simple [36553]
User ID:               501

Date/Time:             2018-06-26 19:31:14.098 -0700
OS Version:            Mac OS X 10.13.5 (17F77)
Report Version:        12
Bridge OS Version:     2.3.1 (15P5064)
Anonymous UUID:        F28A8551-0076-489A-05C6-CC8D7DDA548C

Sleep/Wake UUID:       6DC020AA-F227-4561-AF6D-5E43F66EAD1F

Time Awake Since Boot: 1100000 seconds
Time Since Wake:       290000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x000000000000003c
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

Add node editor into custom application

Hi!
Is there any form (that means: I cannot found it) to integrate the libs generated from your solution into my project?
I use GLFW3 & glad as a render. All in Windows.
I cannot add this to my project.
Nice work!!!!!!!!!

Nested State Machine

I am trying to create a state machine execution visualization with nested state machines. I attempted to follow the example of the comment from the blueprints example for grouping the child states of a state machine. I can add child state machine nodes to the parent node, but I am having trouble adding pins to the parent node. After adding a group to the parent node the pins no longer react to links.

This led to discovering the comment on line 4789 in imgui_node_editor.cpp

if (m_IsGroup)
{
// Groups cannot have pins. Discard them.
for (auto pin = m_CurrentNode->m_LastPin; pin; pin = pin->m_PreviousPin)
pin->Reset();
m_CurrentNode->m_Type = NodeType::Group;
m_CurrentNode->m_GroupBounds = m_GroupBounds;
m_CurrentNode->m_LastPin = nullptr;
}

Is there a reason why groups cannot have pins?

Removing the logic for discarding the pins appears to enable links to be created. Is there a better approach for creating this type of functionality?

Imgui Docking Feature

Will there be a new version or branch using imgui docking branch?
I have tried the docking feature of imgui. I like the docking feature and auto layout very much. It's so convenient.

error <end Parse>

NodeEditor.h
template
const Tag SafePointerType::Invalid{ 0 };

嚴重性 程式碼 說明 專案 檔案 行 隱藏項目狀態
錯誤 C2143 語法錯誤: 遺漏 ';' (在 '' 之前) NodeEditor E:\tree\imgui-master\imgui-node-editor-master\NodeEditor\Source\Editor.cpp 5107

修正為
template
const Tag SafePointerType::Invalid( 0 ); // { -> ( , } -> )

build command in readme is wrong

$ cd Build
$ cmake --build Build --config Release
Error: [redacted]/imgui-node-editor-master/Build/Build is not a directory

Don't need to cd Build.

Fonts blurry on HiDPI

Firstly, thanks for such awesome tool!

I plugged libfreetype and successfully loaded Fira Code font, but fonts are still blurry on 4k, i tried to adjust fringeScale, but it didn't made any sharpness, only overall scale, that can be also achieved with glfw window flags.

I see a lot of commented code related to fringeScale in your recent commits (Blueprints example), but can't spot the place where do i need to start my further investigation.

I know that the issue more likely must be submitted directly to imgui project, but there is custom/modified version of imgui in your project (especially with fringeScale).

Can you suggest the direction for further issue solving ?

Fonts are loaded in a such way:

    ImGuiIO& io = ImGui::GetIO();
    ImFontConfig font_config = ImFontConfig();
    font_config.OversampleH = 7;
    font_config.OversampleV = 5;

    io.Fonts->AddFontFromFileTTF("../FiraCode-Regular.ttf", 16.0f, &font_config);

    unsigned int flags = ImGuiFreeType::ForceAutoHint;
    ImGuiFreeType::BuildFontAtlas(io.Fonts, flags);

    unsigned char* out_pixels;
    int out_width;
    int out_height;
    io.Fonts->GetTexDataAsRGBA32(&out_pixels, &out_width, &out_height);

OS: Ubuntu 19.10, libfreetype 2.10.1

ed::PinId.Get() always returns 0

I've created a Pin struct that contains an ed::PinId. I'm storing Pins in an unordered_map<int, Pin>, mapping int to Pin. (Originally, I tried to create a unordered_map<ed::PinId, Pin> but it complained that the Hash function for ed::PinId was deleted.)

When I call QueryNewLink() a new link and get a PinId, I try to get its associated Pin from the map by calling theMap[pinId.Get()] however, Get() always returns 0, no matter what the PinId was set to.

Am I doing something wrong here?

build fails on Windows

imgui-node-editor-master\nodeeditor\source\editor.cpp(2191): error C2512: 'ax::NodeE ditor::Detail::ObjectId': no appropriate default constructor available

No license

Hi there,

Would you be agreeable to licensing this repo under MIT or Apache 2?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.