I believe this is a python bug #60799

Closed
opened 2019-01-23 16:50:28 +01:00 by AB · 9 comments

System Information
Operating system: Window 10 64 bit
Graphics card: Nvidia 1060 GTC PNY

Blender Version
Broken: 2.79b release

Short description of error

all the info's are here
https://devtalk.blender.org/t/uv-stitch-python-problem/4532
https://blender.stackexchange.com/questions/126382/blender-uv-stitch-operator-problem

**System Information** Operating system: Window 10 64 bit Graphics card: Nvidia 1060 GTC PNY **Blender Version** Broken: 2.79b release **Short description of error** all the info's are here https://devtalk.blender.org/t/uv-stitch-python-problem/4532 https://blender.stackexchange.com/questions/126382/blender-uv-stitch-operator-problem
Author

Added subscriber: @MaTcHo0o

Added subscriber: @MaTcHo0o
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

Please describe the error here in the report and don't just link to external sites.

Also make it easy for us to reproduce the issue.

Please describe the error here in the report and don't just link to external sites. Also make it easy for us to reproduce the issue.

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2019-01-23 17:01:06 +01:00

There's no bug here. UV operators only work in a UV editor, they are not intended as a programming API but as tools for users.

It's possible to use some tricks and change the current area or context to be a UV editor.
https://docs.blender.org/api/blender_python_api_master/bpy.ops.html

It could be useful to make the UV operators work outside of the UV editor too, but that's outside the scope of the bug tracker.

There's no bug here. UV operators only work in a UV editor, they are not intended as a programming API but as tools for users. It's possible to use some tricks and change the current area or context to be a UV editor. https://docs.blender.org/api/blender_python_api_master/bpy.ops.html It could be useful to make the UV operators work outside of the UV editor too, but that's outside the scope of the bug tracker.
Author

I tried overriding the context but it don't work
The external links was my post that i made but here is what in them :

I am trying to execute the stitch operator but it works only in gui when trying to execute it from a command line it doesn’t run the operator here is a code snippet that i have now :

for ob in bpy.data.objects:

  if ob.type == 'MESH':
      j = 0
      ob.select = True
      bpy.context.scene.objects.active = ob
    #############################
      bpy.ops.object.mode_set(mode="EDIT")
      bpy.ops.mesh.select_all(action='SELECT')
      bpy.ops.uv.select_all(action="SELECT")
      bpy.ops.uv.stitch(use_limit=False, snap_islands=True, limit=0.01, static_island=0, midpoint_snap=False, mode='VERTEX')
      bpy.ops.object.mode_set(mode="OBJECT")

Executing this code inside the command line using the “–background” doesn’t give any errors but it don’t run the operator

I tried overriding the context but it don't work The external links was my post that i made but here is what in them : I am trying to execute the stitch operator but it works only in gui when trying to execute it from a command line it doesn’t run the operator here is a code snippet that i have now : for ob in bpy.data.objects: ``` if ob.type == 'MESH': j = 0 ob.select = True bpy.context.scene.objects.active = ob ``` ############################# ``` bpy.ops.object.mode_set(mode="EDIT") bpy.ops.mesh.select_all(action='SELECT') bpy.ops.uv.select_all(action="SELECT") bpy.ops.uv.stitch(use_limit=False, snap_islands=True, limit=0.01, static_island=0, midpoint_snap=False, mode='VERTEX') bpy.ops.object.mode_set(mode="OBJECT") ``` Executing this code inside the command line using the “–background” doesn’t give any errors but it don’t run the operator

I'm afraid running UV stitch in background mode is simply not supported, it requires a user interface currently.

I'm afraid running UV stitch in background mode is simply not supported, it requires a user interface currently.
Author

Ok thanks for the clarification

Ok thanks for the clarification
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
3 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#60799
No description provided.