Page MenuHome

Quadriflow remesh operator don't stack operations
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-4.15.0-66-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 965M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.50

Blender Version
Broken: version: 2.82 (sub 1), branch: master, commit date: 2019-11-20 21:25, hash: rBba1e9ae4733a
Worked: (optional)

Short description of error
I'm trying to automate remeshing of multiple objects by writing a script that would run quadriflow operator on every selected object. I'm doing it by looping trough selection in a python script, selecting object one by one and applying quadriflow remesh operator to an selected object. It works fine if I got from 1 to 2 objects. But! If this list of selected objects containing more than 2 objects(3 or more) remeshing works only for the first and the last objects in the list. And not the first and last selected but first and last objects by date.

I've tried to insert a pause(sleep) between next selection or iterating through a list of all objects in the scene but to no avail. Only the first and the last objects by date are remeshed with everything in between being ignored.

inb4 I'm no python expert by any means just an artists who happens to know how to loosely cobble some lines of code together.

Exact steps for others to reproduce the error
With default file:

  1. create 3+ suzannas.
  2. Subdibide them a couple of times and apply.
  3. Make a simple script iterating through selected objects:

(smth like that)

list_of_object=list()
for obj in bpy.context.selected_objects: 
    list_of_object.append(obj)
  
bpy.ops.object.select_all(action='DESELECT')
 
for items in list_of_object:
    bpy.ops.object.select_all(action='DESELECT')
    items.select_set(state=True)
    bpy.context.view_layer.objects.active =items
    result = bpy.ops.object.quadriflow_remesh('EXEC_DEFAULT', mode="FACES", use_paint_symmetry=True, use_preserve_boundary=True, use_mesh_curvature=True, target_faces=500)
  1. Select all suzannas and run the script.
  2. Get only two of them remeshed.

Or run the script in an attached blend file.


1.Open the blend file

  1. Run the script
  2. Only two of four suzannas will be remeshed.

I don't really sure it's the problem with a remesh operator since I've been making such scripts before only for baking and in case of baking there was an option to run an operator in batches by EXEC_DEFAULT(it will freeze the interface while working but will produce expected results) but that's not the case with a quadriflow remesher obviously.

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to Low.

This is using the jobs system and puts every job with the same owner [scene].
Confirming on first sight, will check if we can get around it...

Note this might very well turn out to be a known limitation and not considered a bug, but will let @Sebastian Parborg (zeddb) or @Bastien Montagne (mont29) decide here [patch works though :)]

mankysee (mankysee) added a comment.EditedNov 25 2019, 4:09 PM

Note this might very well turn out to be a known limitation and not considered a bug, but will let @Sebastian Parborg (zeddb) or @Bastien Montagne (mont29) decide here [patch works though :)]

Thank you so much!

I don't mind if it will turns out as a limitation but for now that's not communicated and a user gets no indication that something gone wrong. A message saying that would be nice in that case. And a way to batch remesh operators too, of course :) Since right now there is no way(at least from what I've tried with sleep) to do that.

@Philipp Oeser (lichtwerk) perhaps we could just add a flag to make the operator blocking again if the uses wants to batch convert stuff?

The current system is just in place so that blender doesn't completely lock up when running the quadriflow operator.

It seems like this is a bug, or at least a miss implementation of the quadriflow operator API.

The *_exec functions should in be blocking while _invoke should be non blocking. I'll take a look at this and fix it (hopefully before Christmas if time allows).

Why not use something like D6305?

Because as you noticed, you will lose the progress bar and other things. I talked to Bastien about this and it seems like the proper way to do it is to have exec block and invoke not blocking.
This is how it is done from certain other operators too.

Sebastian Parborg (zeddb) changed the subtype of this task from "Report" to "Bug".