Dynamic topology toggle registers correctly but fails when run from script #45418

Closed
opened 2015-07-12 15:57:42 +02:00 by Fasit · 6 comments

This is a kind of awkward situation.

This function "bpy.ops.sculpt.dynamic_topology_toggle()" toggles dynatopo sculpting. Some addons including mine need to check and disable the dynamic topology so that we can access, copy or change the BMesh elements custom data layer properties (masks, weights, etc).

Here is the problem ; If I disable dynatopo from the ui and execute the script, everything works as expected. When we use the toggle function from script; the script executes without any errors but as if dynatopo wasn't toggled off (so the results are not correct).

Testing :

Mask Tools:

You need to install the addon using "Install from file" or if you want to manually install, then all files need to be together in the blender addon folder.

Steps to reproduce :

  1. In sculpt mode make sure dynatopo is disabled, paint a mask and in the tool shelf select sculpt tab/ mask tools

  2. when you click "Create" in "Vertex Group" section on the tool shelf, it will convert the mask to a vertex group.

  3. now clear the mask (alt-m) and click on "Create" in " Mask" section on the tool shelf, this will convert vgroup to a new mask.

With dynatopo off the script works but with dynatopo enabled it doesn't.

If you enable dynatopo and repeat the same steps the script will either return a blank mesh or a random masked mesh.

So I toggle dynatopo off with "bpy.ops.sculpt.dynamic_topology_toggle()" function in the script.

When I check and print it on the console it also returns that it is off, but the results are as if it is turned on.

Line in which toggles is maskToVGroup.py > 27

Check at maskToVGroup.py > 29

MaskTools_v03.zip

This is a kind of awkward situation. This function "bpy.ops.sculpt.dynamic_topology_toggle()" toggles dynatopo sculpting. Some addons including mine need to check and disable the dynamic topology so that we can access, copy or change the BMesh elements custom data layer properties (masks, weights, etc). Here is the problem ; If I disable dynatopo from the ui and execute the script, everything works as expected. When we use the toggle function from script; the script executes without any errors but as if dynatopo wasn't toggled off (so the results are not correct). Testing : Mask Tools: You need to install the addon using "Install from file" or if you want to manually install, then all files need to be together in the blender addon folder. Steps to reproduce : 1) In sculpt mode make sure dynatopo is disabled, paint a mask and in the tool shelf select sculpt tab/ mask tools 2) when you click "Create" in "Vertex Group" section on the tool shelf, it will convert the mask to a vertex group. 3) now clear the mask (alt-m) and click on "Create" in " Mask" section on the tool shelf, this will convert vgroup to a new mask. With dynatopo off the script works but with dynatopo enabled it doesn't. If you enable dynatopo and repeat the same steps the script will either return a blank mesh or a random masked mesh. So I toggle dynatopo off with "bpy.ops.sculpt.dynamic_topology_toggle()" function in the script. When I check and print it on the console it also returns that it is off, but the results are as if it is turned on. Line in which toggles is maskToVGroup.py > 27 Check at maskToVGroup.py > 29 [MaskTools_v03.zip](https://archive.blender.org/developer/F206232/MaskTools_v03.zip)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @ygtsvtr

Added subscriber: @ygtsvtr

Added subscriber: @ideasman42

Added subscriber: @ideasman42

This is too much asking us to look into your code.

Please attach a single script (or blendfile+script) which shows the error and does nothing else.

This is too much asking us to look into your code. Please attach a single script *(or blendfile+script)* which shows the error and does nothing else.
Author

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Fasit closed this issue 2015-07-13 23:40:38 +02:00
Fasit self-assigned this 2015-07-13 23:40:38 +02:00
Author

Nevermind the problem is somewhere else, "bpy.ops.sculpt.dynamic_topology_toggle()" works fine. Sorry for the false alarm.

Nevermind the problem is somewhere else, "bpy.ops.sculpt.dynamic_topology_toggle()" works fine. Sorry for the false alarm.
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
2 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#45418
No description provided.