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

Object has no evaluated mesh data #1321

Closed
jlampel opened this issue Jun 12, 2024 · 15 comments
Closed

Object has no evaluated mesh data #1321

jlampel opened this issue Jun 12, 2024 · 15 comments
Labels
bug can't replicate v4 Applies to RF version 4x

Comments

@jlampel
Copy link
Member

jlampel commented Jun 12, 2024

One user ran into the following error when creating a new retopology object with RetopoFlow 4 alpha:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\startup\bl_operators\wm.py", line 2315, in execute
    if fn(context, space_type, self.name, as_fallback=self.as_fallback):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\retopoflow_4\addon_common\common\functools.py", line 34, in wrapped
    if fn_pre: fn_pre(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\retopoflow_4\retopoflow\rfcore.py", line 148, in tool_changed
    RFCore.start(context)
  File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\retopoflow_4\retopoflow\rfcore.py", line 190, in start
    bpy.ops.retopoflow.core()
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\bpy\ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Python: Traceback (most recent call last):
  File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\retopoflow_4\retopoflow\rfcore.py", line 293, in execute
    prep_raycast_valid_sources(context)
  File "C:\Users\Lucas\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\retopoflow_4\retopoflow\common\raycast.py", line 70, in prep_raycast_valid_sources
    obj.ray_cast(Vector((0,0,0)), Vector((1,0,0)))
RuntimeError: Error: Object 'Cube.001' has no evaluated mesh data
Location: C:\Program Files\Blender Foundation\Blender 4.1\4.1\scripts\modules\bpy\ops.py:109

Here's what he says:

Hi! I figured it out (with the help of Chat GPT, so i don't really know). It shows me this error when I try to add the retopology object, in object mode, and when I enter edit mode. Apparently, this "RuntimeError: Error: Object 'Cube.001' has no evaluated mesh data" means its looking for a Cube.001 when there is none in my scene, so it crashes. I tried it in a new file, with nothing on it, and added a Cube named Cube.001 and it worked. Maybe it's hardcoded to look for a Cube.001 instead of using the name of the selected object? I may be wrong, I'm a beginner in programming and know nothing about addons. Hope this helps!

That doesn't really make sense, but maybe it holds a clue. So far, I have not been able to replicate the issue. It must have to do with the newly created retopology object mesh data, since even non-mesh objects work fine with the At Active command.

@jlampel jlampel added bug can't replicate v4 Applies to RF version 4x labels Jun 12, 2024
@vxlcoder
Copy link
Contributor

RF does not use hard-coded names. i can write some code to catch and report this error gracefully, but it would be far better to figure out how to replicate this error and fix it. was he able to reproduce this issue, or was this a one-time thing?

i'll take a closer look when I get a chance.

@JornBoven
Copy link

Error

Noticed the seemingly same error~

@vxlcoder
Copy link
Contributor

thanks for the screenshot, @JornBoven!

are you able to reproduce this issue again?

can you share the blend file that causes this so we can inspect it closer?

you can send it to [email protected] if you don't want to post it here.

thanks!

@JornBoven
Copy link

JornBoven commented Jun 15, 2024

There is another error message when clicking on the polypen icon

image

The issue is persistence in this particular scene, but just like the OP, when i copy the model over to a fresh blender scene, retopoflow functions as expected.

Ill only be able to share the file if I remove all other content out of the scene. But even after purging the scene, the issue is still there. I've sent [email protected] an email with this file~

@vxlcoder
Copy link
Contributor

got the file. Thank you very much!

It seems there is an object in the .blend file called Body.001, but it's not in the scene. Well, it is, but it's not.

image

Digging into this more...

@vxlcoder
Copy link
Contributor

ah, it's in the scene, but not the view layer...

vxlcoder added a commit that referenced this issue Jun 15, 2024
`context.scene.objects` may include items that are not in the active
view layer, which causes `ray_cast` to fail because it has no eval'd
mesh data (do not need to eval it if it's not visible).  switched to
`context.view_layer.objects` to only iterate over objects in the view
layer.
@vxlcoder
Copy link
Contributor

@JornBoven
Copy link

Thanks you!~

I've installed the version from the dropbox. But it's not working for me yet. the "retopology at cursor/active" buttons don't work. And when I go into the a mesh and click the polypen, it gives this error

image

@vxlcoder
Copy link
Contributor

@JornBoven, maybe try uninstalling the previous version completely, restart blender, then reinstall from the zip?

If that does not fix it, what does it do when you try using the Add > Retopology at Cursor or Active buttons? If you're using Windows, try opening the system console link and copy-paste everything you see there here. The console can sometimes have additional information that is useful for debugging issues like this (works here but not there).

Thank you for helping us debug this!

@JornBoven
Copy link

ERROR (wm.operator): C:\Users\blender\git\blender-v410\blender.git\source\blender\windowmanager\intern\wm_event_system.cc:1571 wm_operator_invoke: invalid operator call 'RETOPOFLOW_OT_newtarget_active'

Removed all old versions of RT, restarted my PC and then reinstalled the one you've send me. Tested it in a new scene and it had the same issues so I copied the error message from the console.

@vxlcoder
Copy link
Contributor

Did anything else get printed to the console? There might be quite a lot there.

Can you replicate this error using the same .blend file you sent us via email? Do you get this same error if you load the default scene (with default cube, etc.)?

I'm not entirely sure why you're getting this error inside Blender's Python code, and I am unable to replicate this issue on my end to see what is happening.

@JornBoven
Copy link

I just tested it again and did encountered the error message. The buttons still do not work, but when i create my own secondary mesh -> go into edit mode -> select the poly tool. Then it functions as expected.

so only the buttons don't seem to work with me.

I've sent you a screen recording with my findings

@vxlcoder
Copy link
Contributor

perfect! just watched it. digging into it now

@vxlcoder
Copy link
Contributor

ah!

I am able to reproduce your issue here!

Here's something I found: if you open the add menu (3D Object Mode Shift+A) and choose Retopology at XXX, it breaks. However, if you choose Retopology at XXX from the 3D View Add menu instead (before using Shift+A menu), it works. Something about calling that Operator from the Shift+A menu causes RF to break.

@JornBoven, will you please confirm that this works on your end, too?

Looking at that Shift+A menu now...

@vxlcoder
Copy link
Contributor

since the Operator problem is a separate issue, i created a separate GH issue (#1322) to track it.

closing this issue, as it appears to be fixed.

You can test out the fix using the same link from above: https://www.dropbox.com/scl/fi/tgbmx8b690orvcc31yp7a/RetopoFlow_v4.0.0-alpha-GitHub.zip?rlkey=380tjledg3h3o0c9g3xc1vloo&st=34u2ntfs&dl=0

Thank you again for helping us debug this issue, @JornBoven!

please let us know if you have any other problems!

Happy retopo'ing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can't replicate v4 Applies to RF version 4x
Projects
None yet
Development

No branches or pull requests

3 participants