Quadriflow remesh operator don't stack operations #71871

Closed
opened 2019-11-24 23:27:36 +01:00 by mankysee · 12 comments

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: ba1e9ae473
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.0007_quadriflow_tests_03.blend
1.Open the blend file
2. Run the script
3. 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.

**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: `ba1e9ae473` 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) ``` 4. Select all suzannas and run the script. 5. Get only two of them remeshed. Or run the script in an attached blend file.[0007_quadriflow_tests_03.blend](https://archive.blender.org/developer/F8163386/0007_quadriflow_tests_03.blend) 1.Open the blend file 2. Run the script 3. 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.
Author

Added subscriber: @mankysee

Added subscriber: @mankysee
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Philipp Oeser self-assigned this 2019-11-25 15:26:23 +01:00
Member

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

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

Added subscribers: @ZedDB, @mont29

Added subscribers: @ZedDB, @mont29
Member

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

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

In #71871#817171, @lichtwerk wrote:
Note this might very well turn out to be a known limitation and not considered a bug, but will let @ZedDB or @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.

> In #71871#817171, @lichtwerk wrote: > Note this might very well turn out to be a known limitation and not considered a bug, but will let @ZedDB or @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.

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

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

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).
Philipp Oeser was unassigned by Sebastian Parborg 2019-11-25 19:13:38 +01:00
Sebastian Parborg self-assigned this 2019-11-25 19:13:38 +01:00
Member

Why not use something like D6305?

Why not use something like [D6305](https://archive.blender.org/developer/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.

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 was unassigned by Dalai Felinto 2019-12-23 13:42:35 +01:00
Sebastian Parborg self-assigned this 2020-01-15 14:41:02 +01:00

This issue was referenced by 594945eb01

This issue was referenced by 594945eb011e3abe35b586eaf780ccc28ee7191f

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71871
No description provided.