Quadriflow remesh operator don't stack operations #71871

Closed
opened 3 years ago 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.
Poster

Added subscriber: @mankysee

Added subscriber: @mankysee
Collaborator

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
lichtwerk self-assigned this 3 years ago
Collaborator

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

Added subscribers: @ZedDB, @mont29

Added subscribers: @ZedDB, @mont29
Collaborator

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 :)]
Poster

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.
ZedDB commented 3 years ago
Collaborator

@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.
ZedDB commented 3 years ago
Collaborator

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).
lichtwerk was unassigned by ZedDB 3 years ago
ZedDB self-assigned this 3 years ago
Collaborator

Why not use something like D6305?

Why not use something like [D6305](https://archive.blender.org/developer/D6305)?
ZedDB commented 3 years ago
Collaborator

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.
ZedDB was unassigned by dfelinto 3 years ago
ZedDB self-assigned this 3 years ago
Collaborator

This issue was referenced by 594945eb01

This issue was referenced by 594945eb011e3abe35b586eaf780ccc28ee7191f
ZedDB commented 3 years ago
Collaborator

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
ZedDB closed this issue 3 years ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71871
Loading…
There is no content yet.