Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph Editor is creating imgui.ini file #1471

Closed
marwie opened this issue Aug 21, 2023 · 7 comments
Closed

Graph Editor is creating imgui.ini file #1471

marwie opened this issue Aug 21, 2023 · 7 comments

Comments

@marwie
Copy link
Contributor

marwie commented Aug 21, 2023

Steps to reproduce:

  1. Open the editor
  2. Save a material at an empty folder on your system
  3. The directory now contains one file (your material)
  4. Close the editor
  5. Notice that the folder now contains a file named imgui.ini

Windows 10

Also note: the imgui.ini file contains information about position and size of the window but it doesnt seem to be used at all

@marwie marwie changed the title Graph Editor is creating imgui file Graph Editor is creating imgui.ini file Aug 21, 2023
@meshula
Copy link

meshula commented Aug 23, 2023

Dear Imgui itself reads the ini file. When new windows and panels are created it uses that information to restore the state and panel layout of the most recent previous user session. Deleting the file restores the window layout to the default arrangement indicated in the viewer's source code.

@marwie
Copy link
Contributor Author

marwie commented Aug 23, 2023

The file seems to never be modified nor does changing the values in it affect the graph view when i restart / open the graph editor again.

But even if the file would be used it shouldnt be created in each directory i ever opened a materialx file in

@meshula
Copy link

meshula commented Aug 24, 2023

Yes, that is definitely the default behavior of Dear ImGui. There is a discussion about it here, ocornut/imgui#4294 including various solutions. Perhaps the thing to do is to get some consensus on the behavior. For example, it might make sense to always store the ini file in a platform specific AppData directory.

This might be a good topic to bring up in the Academy Software Foundation Slack, in the #materialx channel. Perhaps the collective wisdom there might help come to a consensus about a good behavior.

@jstone-lucasfilm
Copy link
Member

My initial thought is that we should disable the automatic writing/reading of INI files in the MaterialX Graph Editor, since it's not capturing useful information about the user's session state.

As an example, here's the output INI file in a recent session, where it's only capturing the state of the default debug window, and not the state of active user windows:

[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0

From the discussion thread that @meshula links above, here are instructions on how we can potentially disable this in the MaterialX Graph Editor:

ocornut/imgui#4294 (comment)

@dgovil
Copy link
Contributor

dgovil commented Oct 6, 2023

A related PR is #1257

I'd set up the pathing to use default config locations on posix systems. I'd left windows alone for lack of a system to test the conventions. It would be good if someone could make windows have parity.

@kwokcb
Copy link
Contributor

kwokcb commented Oct 11, 2023

To disable, it looks like you can just null the filenames as mentioned here , but you need a reference, which is what's done in Main.cpp. So we'd need these lines:

io.IniFilename = NULL;
io.LogFilename = NULL;

This will override both the ini and log file which is set in ImuiIO constructor:

IniFilename = "imgui.ini"; // Important: "imgui.ini" is relative to current working dir, most apps will want to lock this to an absolute path (e.g. same path as executables).
 LogFilename = "imgui_log.txt";

@jstone-lucasfilm
Copy link
Member

Thanks to @iukpo-lucasfilm for addressing this in #1570, and thanks as well to @marwie for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants