CGCookie / retopoflow

A suite of retopology tools for Blender
2.53k stars 251 forks source link

[BUG] Viewport Controls randomly stopping to work #1125

Open VertexBeat opened 2 years ago

VertexBeat commented 2 years ago

Retopoflow Version: 3.8.2

Blender Version/Hash: 3.1.2

Platform Version/Distribution: Apple M1

When working in Retopoflow, I get completely random freezes and the controls in the 3D viewport stop working completely. Sometimes it happens, when switching tools or after using a tool (pressing CTRL). After a while, it recovers, and the viewport is usable again. It happens really often!

examples:

1) Switched to Relaxed Tool to relax my geometry, afterwards, controls freezes. I attached a video, where at the end you can see me trying to rotate around the model, but the viewport isn't working

2) Used Loop Tools, after inserting a loop, viewport froze

3) Using Pen Tool, after adding a view quads, viewport freezes.

https://user-images.githubusercontent.com/13951053/170686454-a5538c21-d521-46fd-a1ad-0a054ceac567.mov

 

How to reproduce:

vxlcoder commented 2 years ago

Thanks for the report, @Traumwolf.

I also have an M1, but I haven't seen this behavior before.

Can you do a couple of things to help us debug this?

First, try starting Blender from the terminal (instructions), then start RetopoFlow and use it as normal. Once it does the pause thing, wait until it finishes, then close out of RetopoFlow and Blender. Then copy all the text that is in the terminal (there could be a lot) and paste it as a comment to this issue. RetopoFlow will report a lot of details to the terminal, and I'm hoping that there might be a clue in there.

Second, I have noticed that Blender 3.1.2 has had a few issues, especially on the M1. Can you try using Blender 3.2.0 Beta to see if it improves? There was an issue regarding compiling Blender's shaders that was fixed in 3.2.0.

VertexBeat commented 2 years ago
Last login: Fri May 27 10:24:33 on console
dom@MacBook-Air-von-Dominique Blender.app % ./Contents/MacOS/Blender
Read prefs: /Users/dom/Library/Application Support/Blender/3.1/config/userpref.blend
Registered MACHIN3tools 0.10.0 with 13 tools, 8 pie menus
keKit Prefs found - File Settings Applied : /Users/dom/Library/Application Support/Blender/3.1/scripts

[kekit]
Error

Error:
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
register
addon not loaded: 'quick_pipe'
cause: 
NAME : %s interactivetoolsblender-master
HardOps 0.9.87.31 available!
module changed on disk: '/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/mesh_f2.py' reloading...
The custom presets directory seems invalid: /Remap Presets/
------- Registered Action Recorder -------
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'mira_tools'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'mifth_tools'
module changed on disk: '/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/send2ue/resources/extensions/ue2rigify.py' reloading...
Reloading external rigs...
Reloading external metarigs...
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 351, in enable
    mod = __import__(module_name)
ModuleNotFoundError: No module named 'RetopoFlow'
-----------Load Local Actions-----------
-----------Load Local Actions-----------
------------------Load-----------------
/var/folders/hd/_n8hvgj93ds_g5mbmz7nbt4m0000gn/T/blender_o1FdXJ/tempcats.json
/var/folders/hd/_n8hvgj93ds_g5mbmz7nbt4m0000gn/T/blender_o1FdXJ/temp.json
Read blend: /Users/dom/Documents/3D/Projects/Work_Oathbound/CharacterCast_01/01_Retopo/M_Human_Wizard/Retopo_M_Human_Wizard.blend
-----------Load Local Actions-----------
UNSUPPORTED (log once): POSSIBLE ISSUE: unit 3 GLD_TEXTURE_INDEX_2D_ARRAY is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
addon_utils.disable: RetopoFlow-2 not disabled
Modules Installed (RetopoFlow-2) from '/Users/dom/Downloads/RetopoFlow-2.zip' into '/Users/dom/Library/Application Support/Blender/3.1/scripts/addons'
RetopoFlow: Initial load
Addon Common: (shaders) GLSL Version: 4.10
Addon Common: compiling UI shader
Addon Common: batching for shader
Addon Common: UI shader initialized
Addon Common: ########################################
              Loading shader using Shader
RetopoFlow Shader Info: uiShader (388)
  attribs: 
  uniforms: uMVPMatrix (10), left (6), right (21), top (22), bottom (15), width (27), height (16), depth (4), margin_left (7), margin_right (3), margin_top (14), margin_bottom (28), padding_left (23), padding_right (9), padding_top (2), padding_bottom (1), border_width (25), border_radius (5), border_left_color (19), border_right_color (26), border_top_color (20), border_bottom_color (8), background_color (18), using_image (0), image_fit (17), image (24)
RetopoFlow git: None
gpustate.gpu_info cannot get shader version!
RetopoFlow options path: /Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/RetopoFlow_options.json
No options file
Addon Common: (bmesh_render) GLSL Version: Apple, Apple M1, 4.1 Metal - 76.3, (no shader version)
cgcookie addon: Verbose is enabled
cgcookie addon: Wrote out updater JSON settings with content:
cgcookie addon: {'last_check': '', 'backup_date': '', 'update_ready': False, 'ignore': False, 'just_restored': False, 'just_updated': False, 'version_text': {}}
Bad characters found in add-on: {'-'}
Bad characters found in add-on: {'-'}
Bad characters found in add-on: {'-'}
Bad characters found in add-on: {'-'}
Bad characters found in add-on: {'-'}
Bad characters found in add-on: {'-'}
RetopoFlow keymaps path: /Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/RetopoFlow_keymaps.json
RetopoFlow: setting up scaling factor
  Unit scaling factor: 0.15630891025066376
RetopoFlow: scaling view, sources, and target by 6.40
RetopoFlow: storing clip distances: 0.009999999776482582 1000.0
Addon Common Warning: Cannot toggle header visibility (addon_common/common/blender.py: toggle_screen_header)
  Skipping while bug exists in Blender 3.0+, see: https://developer.blender.org/T93410
Addon Common: Loaded font "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/addon_common/common/fonts/DroidSans-Blender.ttf" as id 3
RetopoFlow: Pausing help image preloading (1653651459.1780381)
RetopoFlow: Setting up target mesh (0.012003183364868164)
RetopoFlow: Setting up source mesh(es) (0.012221097946166992)
  rfsources...
  bboxes...
  drawing...
  done!
RetopoFlow: Setting up symmetry data structures (0.005915164947509766)
RetopoFlow: Setting up rotation target (0.005962848663330078)
RetopoFlow: Setting up RetopoFlow states (0.015560150146484375)
RetopoFlow: Setting up RetopoFlow tools (0.022196054458618164)
RetopoFlow: Setting up grease marks (0.005816936492919922)
RetopoFlow: Setting up visualizations (0.008163213729858398)
RetopoFlow: Setting up user interface (0.016549110412597656)
RetopoFlow: Setting up undo system (0.3684380054473877)
RetopoFlow: Checking auto save / save (0.015690088272094727)
RetopoFlow: Checking target symmetry (0.012694120407104492)
RetopoFlow: Loading welcome message (0.01314687728881836)
Addon Common: Loaded font "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/addon_common/common/fonts/OpenSans-Bold.ttf" as id 4
Addon Common: Loaded font "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/addon_common/common/fonts/DejaVuSansMono.ttf" as id 5
RetopoFlow: Resuming help image preloading (0.4942631721496582)
RetopoFlow: done with start
saving backup: /Users/dom/Documents/3D/Projects/Work_Oathbound/CharacterCast_01/01_Retopo/M_Human_Wizard/Retopo_M_Human_Wizard_RetopoFlow_AutoSave.blend
  deleting old backup: /Users/dom/Documents/3D/Projects/Work_Oathbound/CharacterCast_01/01_Retopo/M_Human_Wizard/Retopo_M_Human_Wizard_RetopoFlow_AutoSave.blend1
  renaming prev backup: /Users/dom/Documents/3D/Projects/Work_Oathbound/CharacterCast_01/01_Retopo/M_Human_Wizard/Retopo_M_Human_Wizard_RetopoFlow_AutoSave.blend1
  saving...
Info: Saved "Retopo_M_Human_Wizard_RetopoFlow_AutoSave.blend"
RetopoFlow: scaling view, sources, and target by 0.16
Saved session recovery to '/var/folders/hd/_n8hvgj93ds_g5mbmz7nbt4m0000gn/T/quit.blend'
Unregistered MACHIN3tools 0.10.0.
unregister
Exception in module unregister(): '/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/MaterialUtilities-master/__init__.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/MaterialUtilities-master/__init__.py", line 197, in unregister
    defaultmap = keyconfigs.get("blender").keymaps
AttributeError: 'NoneType' object has no attribute 'keymaps'
Exception in module unregister(): '/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/space_view3d_xray_selection_tools/__init__.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/space_view3d_xray_selection_tools/__init__.py", line 104, in unregister
    ot_keymap.unregister()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/space_view3d_xray_selection_tools/ot_keymap.py", line 198, in unregister
    unregister_me_keyboard_keymap()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/space_view3d_xray_selection_tools/ot_keymap.py", line 120, in unregister_me_keyboard_keymap
    km.keymap_items.remove(kmi)
RuntimeError: Error: KeyMapItem 'MESH_OT_select_lasso_xray' cannot be removed from 'Mesh'

Keymaps Disabled
0
End
End
End
End
End
Exception in module unregister(): '/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/HOps/__init__.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/HOps/__init__.py", line 615, in unregister
    addon.unregister()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/HOps/addon/__init__.py", line 29, in unregister
    keymap.unregister()
  File "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/HOps/addon/keymap.py", line 161, in unregister
    km.keymap_items.remove(kmi)
RuntimeError: Error: KeyMapItem 'HOPS_OT_edit_bool_union' cannot be removed from 'Mesh'

Exception in module unregister(): '/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_align_menu.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_align_menu.py", line 276, in unregister
    km.keymap_items.remove(kmi)
RuntimeError: Error: KeyMapItem 'WM_OT_call_menu_pie' cannot be removed from 'Mesh'

Exception in module unregister(): '/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_delete_menu.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_delete_menu.py", line 98, in unregister
    km.keymap_items.remove(kmi)
RuntimeError: Error: KeyMapItem 'WM_OT_call_menu_pie' cannot be removed from 'Mesh'

Exception in module unregister(): '/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_select_menu.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_select_menu.py", line 267, in unregister
    km.keymap_items.remove(kmi)
RuntimeError: Error: KeyMapItem 'WM_OT_call_menu_pie' cannot be removed from 'Mesh'

Exception in module unregister(): '/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_proportional_menu.py'
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 439, in disable
    mod.unregister()
  File "/Applications/Blender.app/Contents/Resources/3.1/scripts/addons/space_view3d_pie_menus/pie_proportional_menu.py", line 452, in unregister
    km.keymap_items.remove(kmi)
RuntimeError: Error: KeyMapItem 'WM_OT_call_menu_pie' cannot be removed from 'Mesh'

runRenderComplete
runRenderInit
menu_func
------- Unregistered Action Recorder -------
unregister_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered)
Blender quit
Error: Not freed memory blocks: 1870, total unfreed memory 0.032978 MB
dom@MacBook-Air-von-Dominique Blender.app % 
VertexBeat commented 2 years ago

Tried Blender 3.2 ... still the same Problem occurred after a while, but it felt smoother =P

vxlcoder commented 2 years ago

perfect!

ok. There are a bunch of exceptions being reported to the terminal by many other add-ons. let's run a test to see if the other add-ons might be causing issues, or if it is something in RF. Let's try this.

  1. Start Blender from Terminal, same as before
  2. File > Defaults > Load Factory Settings (temporarily disabling all other add-ons)
  3. Edit > Preferences > Add-ons > Enable RetopoFlow
  4. (possibly) open the file you were working on... but also see question below
  5. Start RetopoFlow as before
  6. After recovering from pause, copy-paste the terminal output here again

Question: does RF pause like this when working on the Default Scene and Cube?

vxlcoder commented 2 years ago

Another note: it seems that RetopoFlow was installed into a folder containing a dash (-): RetopoFlow-2. This typically happens if you installed RetopoFlow from a zip that we didn't package. Specifically, GitHub automatically creates a zip (RF's GH page > Code > Download ZIP), but GH will append a dash and the version to the inner folder. Also, this could happen from manually copying the RetopoFlow folder into the add-ons folder where a RetopoFlow already exists.

This likely isn't the cause of the pausing in this issue, but it does cause other issues (specifically with updating).

It would be best to uninstall RetopoFlow and reinstall from an officially packaged zip file from either Blender Market or Releases. Note: if you get it from Releases, make sure to choose the first linked zip, NOT the Source code (zip) one! alternatively, you can rename the folder in your add-ons folder to include only alphanumeric characters or underscore (_).

VertexBeat commented 2 years ago

https://pastebin.com/BqmKtfdh

it's even longer after I deactivated all the addons, tried it on the default Cube Scene, still same issue (3.1.2 again btw. )

VertexBeat commented 2 years ago

yeah, I downloaded a lot of different versions from RetopoFlow, to see, with which version I could continue with my work, so they go added the -2,-3, etc.

3.2.6 worked for me without major problems so far.

vxlcoder commented 2 years ago

Yeah. It's looking like hardops is having problems (and another add-on). might be good to ping masterxeon (I'll send him a message, too).

Again, thanks for helping me debug this!

If you don't mind, can you try disabling all the add-ons (either load factory default or unchecking them manually), save preferences (screenshot below or File > Defaults > Save Startup File), then close and reopen Blender. this should prevent any other add-ons from possibly causing problems. Then, try RF as before. If this pauses again, then I'll run more extensive tests on my M1 dev machine.

image

just saw your comment that 3.2.6 is working. Interesting... if you don't mind trying the test above first, that will help us eliminate other add-ons, then I'll dig into what might have been introduced 3.2.6 -> 3.2.8.

VertexBeat commented 2 years ago

Last login: Fri May 27 14:00:29 on ttys001 dom@MacBook-Air-von-Dominique Blender.app % ./Contents/MacOS/Blender Read prefs: /Users/dom/Library/Application Support/Blender/3.1/config/userpref.blend RetopoFlow: Initial load Addon Common: (shaders) GLSL Version: 4.10 Addon Common: compiling UI shader Addon Common: batching for shader Addon Common: UI shader initialized Addon Common: ######################################## Loading shader using Shader RetopoFlow Shader Info: uiShader (248) attribs: uniforms: uMVPMatrix (10), left (6), right (21), top (22), bottom (15), width (27), height (16), depth (4), margin_left (7), margin_right (3), margin_top (14), margin_bottom (28), padding_left (23), padding_right (9), padding_top (2), padding_bottom (1), border_width (25), border_radius (5), border_left_color (19), border_right_color (26), border_top_color (20), border_bottom_color (8), background_color (18), using_image (0), image_fit (17), image (24) RetopoFlow git: None gpustate.gpu_info cannot get shader version! RetopoFlow options path: /Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/RetopoFlow_options.json Addon Common: (bmesh_render) GLSL Version: Apple, Apple M1, 4.1 Metal - 76.3, (no shader version) cgcookie addon: Verbose is enabled cgcookie addon: Read in JSON settings from file Writing userprefs: '/Users/dom/Library/Application Support/Blender/3.1/config/userpref.blend' ok Info: Preferences saved

Writing userprefs: '/Users/dom/Library/Application Support/Blender/3.1/config/userpref.blend' ok Info: Preferences saved

Read blend: /Users/dom/Documents/3D/Projects/CharacterCast_01/01_Retopo/M_Human_Wizard/Retopo_M_Human_Wizard.blend UNSUPPORTED (log once): POSSIBLE ISSUE: unit 3 GLD_TEXTURE_INDEX_2D_ARRAY is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} Bad characters found in add-on: {'-'} RetopoFlow keymaps path: /Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/RetopoFlow_keymaps.json RetopoFlow: setting up scaling factor Unit scaling factor: 0.15630891025066376 RetopoFlow: scaling view, sources, and target by 6.40 RetopoFlow: storing clip distances: 0.009999999776482582 1000.0 Addon Common Warning: Cannot toggle header visibility (addon_common/common/blender.py: toggle_screen_header) Skipping while bug exists in Blender 3.0+, see: https://developer.blender.org/T93410 Addon Common: Loaded font "/Users/dom/Library/Application Support/Blender/3.1/scripts/addons/RetopoFlow-2/addon_common/common/fonts/DroidSans-Blender.ttf" as id 3 RetopoFlow: Pausing help image preloading (1653654340.511188) RetopoFlow: Setting up target mesh (0.009196043014526367) RetopoFlow: Setting up source mesh(es) (0.011157989501953125) rfsources... bboxes... drawing... done! RetopoFlow: Setting up symmetry data structures (0.006745100021362305) RetopoFlow: Setting up rotation target (0.0059010982513427734) RetopoFlow: Setting up RetopoFlow states (0.019843101501464844) RetopoFlow: Setting up RetopoFlow tools (0.01949906349182129) RetopoFlow: Setting up grease marks (0.006044864654541016) RetopoFlow: Setting up visualizations (0.0057179927825927734) RetopoFlow: Setting up user interface (0.016605854034423828) RetopoFlow: Setting up undo system (0.39578700065612793) RetopoFlow: Checking auto save / save (0.013400793075561523) RetopoFlow: Checking target symmetry (0.01279306411743164) RetopoFlow: Loading welcome message (0.012600898742675781) RetopoFlow: Resuming help image preloading (0.012801170349121094) RetopoFlow: done with start RetopoFlow: scaling view, sources, and target by 0.16 Saved session recovery to '/var/folders/hd/_n8hvgj93ds_g5mbmz7nbt4m0000gn/T/quit.blend'

Blender quit dom@MacBook-Air-von-Dominique Blender.app %


Deactivated all addons, problem still is showing up =/

vxlcoder commented 2 years ago

Ok. thanks for helping! I will dig through this on my M1, and I'll post once I have some news or more questions.

VertexBeat commented 2 years ago

Perfect, thanks to you for the quick support! Let me know, if you need something else!

VertexBeat commented 2 years ago

Any updates?

vxlcoder commented 2 years ago

Unfortunately, @VertexBeat, no updates yet. I've tried to replicate your issue on my M1, but everything I've tried has not resulted in this same issue. I'm still digging, though.

A question: I noticed in your attached video that you used the ~ menu to switch tools. does the pause occur only when you use that menu? In other words, do you also see that pause if you use the main menu (click tool icons to switch tools) or if you use the keyboard shortcuts to switch tools (1, 2, ...)?

I'm wondering if the CookieCutter UI system isn't giving control back to RetopoFlow like it should be.

vxlcoder commented 2 years ago

i did discover and fix an issue with polypen (6b1c7f4), but that's an unrelated issue.

VertexBeat commented 2 years ago

Will try that out and let you know (propably on sunday).

VertexBeat commented 2 years ago

Hey, sorry for the very later reply.

Haven't used Retopoflow for a longer time and just tried it out again on a different project and still the same issue (Blender 3.2.2 and the newest RetopoFlow version).

I have kept a closer look:

1) it completely randomly freezes after I put a Vert with the PenTool, I don't switch tools … if I choose the PenTool at the beginning and just placing verts ….it randomly freezes … I use the hack below to unfreeze. 2) During the freeze I switch the active Window (from Blender to ZBrush) and it works again without issues.

Best