Maniphest T71871

Quadriflow remesh operator don't stack operations
Closed, ResolvedBUG

Assigned To
Sebastian Parborg (zeddb)
Authored By
mankysee (mankysee)
Nov 24 2019, 11:27 PM
Tags
  • BF Blender
  • Sculpt, Paint & Texture
Subscribers
Bastien Montagne (mont29)
mankysee (mankysee)
Philipp Oeser (lichtwerk)
Sebastian Parborg (zeddb)

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.

Revisions and Commits

rB Blender
Abandoned
D7006

Related Objects

Mentioned In
rB1ba4aa37c956: Remove the "use mesh curvature" option from quadriflow
D6305: T71871: Quadriflow remesh jobs dont work simultaniously
Mentioned Here
D6305: T71871: Quadriflow remesh jobs dont work simultaniously

Event Timeline

mankysee (mankysee) created this task.Nov 24 2019, 11:27 PM
Philipp Oeser (lichtwerk) claimed this task.Nov 25 2019, 3:26 PM
Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to Low.
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

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...

Philipp Oeser (lichtwerk) added subscribers: Sebastian Parborg (zeddb), Bastien Montagne (mont29).Nov 25 2019, 3:55 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 :)]

mankysee (mankysee) added a comment.EditedNov 25 2019, 4:09 PM
In T71871#817171, @Philipp Oeser (lichtwerk) wrote:

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.

Sebastian Parborg (zeddb) added a comment.Nov 25 2019, 5:49 PM

@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.

Sebastian Parborg (zeddb) added a comment.EditedNov 25 2019, 7:12 PM

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).

Sebastian Parborg (zeddb) claimed this task.Nov 25 2019, 7:13 PM
Philipp Oeser (lichtwerk) added a comment.Nov 25 2019, 7:30 PM

Why not use something like D6305?

Sebastian Parborg (zeddb) added a comment.Nov 25 2019, 7:58 PM

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.

Dalai Felinto (dfelinto) removed Sebastian Parborg (zeddb) as the assignee of this task.Dec 23 2019, 1:42 PM
Dalai Felinto (dfelinto) added a project: Tracker Curfew.
Sebastian Parborg (zeddb) claimed this task.Jan 15 2020, 2:41 PM
Sebastian Parborg (zeddb) removed a project: Tracker Curfew.
Sebastian Parborg (zeddb) changed the subtype of this task from "Report" to "Bug".
Pablo Dobarro (pablodp606) added a project: Sculpt, Paint & Texture.Feb 27 2020, 10:20 PM
Sebastian Parborg (zeddb) closed this task as Resolved by committing rB594945eb011e: Fix T71871: Quadriflow remesh operator don't stack operations.Mar 3 2020, 3:29 PM
Sebastian Parborg (zeddb) added a commit: rB594945eb011e: Fix T71871: Quadriflow remesh operator don't stack operations.
Sebastian Parborg (zeddb) mentioned this in rB1ba4aa37c956: Remove the "use mesh curvature" option from quadriflow.Mar 3 2020, 5:44 PM