"Orbit Around Selection" and "Frame Selected" combination moves 3d viewport camera when I switch Edit mode to Weight Paint mode and rotate 3d viewport camera. #121206

Closed
opened 2024-04-29 12:56:25 +02:00 by Yutaka Fukumoto · 9 comments

System Information
Operating system: Windows 10
Graphics card: RTX 2070

Blender Version
Broken: 4.1

Enable "Orbit Around Selection" (Preference - Navigation - Orbit Around Selection) and select vertex and do "Frame Selected". After that change Edit mode to other mode like Weight Paint. Right after that just rotate 3d viewport camera, and you will notice 3d viewport camera moves away from selected vertex.

This is the gif image which shows what happens.
Desktop-2024.04.29---19.27.26.gif

This is the blend file. Try what I said.
orbit around selection.blend

I hope this glitch fixed because I need to zoom in on selected vertex to do something other than edit mode thing like weight painting
and texture painting but when I do this camera always moves and it's impossible,

**System Information** Operating system: Windows 10 Graphics card: RTX 2070 **Blender Version** Broken: 4.1 Enable "Orbit Around Selection" (Preference - Navigation - Orbit Around Selection) and select vertex and do "Frame Selected". After that change Edit mode to other mode like Weight Paint. Right after that just rotate 3d viewport camera, and you will notice 3d viewport camera moves away from selected vertex. This is the gif image which shows what happens. ![Desktop-2024.04.29---19.27.26.gif](/attachments/0afdff3c-114a-4cb9-99be-d31a4606d52e) This is the blend file. Try what I said. [orbit around selection.blend](/attachments/50584369-82e6-4ed9-83f5-5bb7311cc9eb) I hope this glitch fixed because I need to zoom in on selected vertex to do something other than edit mode thing like weight painting and texture painting but when I do this camera always moves and it's impossible,
Yutaka Fukumoto added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2024-04-29 12:56:26 +02:00

I think this is caused by selected vertex position which isn't shared with other mode. When I select vertex in Edit mode and rotate 3d viewport camera, Orbit Around Selection is executed properly based on selected vertex position which Blender can refer to in Edit mode , but when I select vertex and change to other mode, this vertex position is lost and Orbit Around Selection has no reference point and does weird rotation. Why selected vertex position can't be shared with other mode? This strange rotation occurs in Sculpt mode too.

I think this is caused by selected vertex position which isn't shared with other mode. When I select vertex in Edit mode and rotate 3d viewport camera, Orbit Around Selection is executed properly based on selected vertex position which Blender can refer to in Edit mode , but when I select vertex and change to other mode, this vertex position is lost and Orbit Around Selection has no reference point and does weird rotation. Why selected vertex position can't be shared with other mode? This strange rotation occurs in Sculpt mode too.
Member

In paint modes, it is actually the last stroke that is taken as the orbit center.
This is intentional (see view3d_orbit_calc_center / BKE_paint_stroke_get_average).

I guess this would be good to mention in the manual (added a PR for this, see blender/blender-manual#104780).

This is intentional behavior though, not a bug in this case, afraid I have to close this one, thx reporting anyways!

In paint modes, it is actually the last stroke that is taken as the orbit center. This is intentional (see `view3d_orbit_calc_center` / `BKE_paint_stroke_get_average`). I guess this would be good to mention in the manual (added a PR for this, see https://projects.blender.org/blender/blender-manual/pulls/104780). This is intentional behavior though, not a bug in this case, afraid I have to close this one, thx reporting anyways!
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2024-04-29 13:49:59 +02:00

but paint mode doesn't have Frame Selected. thanx to that I don't need to zoom in manually. why selected vertex position can't be shared?

but paint mode doesn't have Frame Selected. thanx to that I don't need to zoom in manually. why selected vertex position can't be shared?

if it can't be fixed than I would like to know how to emulate texture paint stroke.
I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera.

This is used as sculpt stroke which does nothing but clicking selected vertex position, but I don't know how paint mode stroke works.

strokes =[ {
"name": "Null Stroke",
"is_start": True,
"location": (v_pos),
"mouse": (0, 0),
"mouse_event" : (0, 0),
"pressure": 0,
"size": 0,
"pen_flip" : False,
"time": 0,
"x_tilt": 0,
"y_tilt": 0
},]

if it can't be fixed than I would like to know how to emulate texture paint stroke. I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera. This is used as sculpt stroke which does nothing but clicking selected vertex position, but I don't know how paint mode stroke works. strokes =[ { "name": "Null Stroke", "is_start": True, "location": (v_pos), "mouse": (0, 0), "mouse_event" : (0, 0), "pressure": 0, "size": 0, "pen_flip" : False, "time": 0, "x_tilt": 0, "y_tilt": 0 },]
Member

but paint mode doesn't have Frame Selected.

Frame Selected also works in paintmodes (based on average stroke as well), should roughly frame the last stroke. Doesnt this work for you?

> but paint mode doesn't have Frame Selected. `Frame Selected` also works in paintmodes (based on average stroke as well), should roughly frame the last stroke. Doesnt this work for you?
Member

if it can't be fixed than I would like to know how to emulate texture paint stroke.
I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera.

The following should work similarly to sculpt (in terms of OperatorStrokeElement), no?

https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint
https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint

> if it can't be fixed than I would like to know how to emulate texture paint stroke. > I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera. The following should work similarly to sculpt (in terms of `OperatorStrokeElement`), no? https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint

if it can't be fixed than I would like to know how to emulate texture paint stroke.
I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera.

The following should work similarly to sculpt (in terms of OperatorStrokeElement), no?

https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint
https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint

I tried this one but it won't work.
I get this error
RuntimeError: Operator bpy.ops.paint.weight_paint.poll() failed, context is incorrect

import bpy

for a in bpy.context.screen.areas:
    if a.type == 'VIEW_3D':
        if bpy.context.object.mode != 'WEIGHT_PAINT':
            bpy.ops.object.mode_set(mode='WEIGHT_PAINT')

            strokes =[ {
              "name": "Null",
              "is_start":True, 
              "location":(0.0, 0.0, 0.0),
              "size": 1.0,
              "time":0.0,
              "pressure": 0.0,
              "pen_flip":False,
              "mouse":(0.0, 0.0) 
            },]

            bpy.ops.paint.weight_paint(stroke= strokes, mode='NORMAL')

why emulating weight paint stroke fails?

> > if it can't be fixed than I would like to know how to emulate texture paint stroke. > > I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera. > > The following should work similarly to sculpt (in terms of `OperatorStrokeElement`), no? > > https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint > https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint I tried this one but it won't work. I get this error RuntimeError: Operator bpy.ops.paint.weight_paint.poll() failed, context is incorrect ``` import bpy for a in bpy.context.screen.areas: if a.type == 'VIEW_3D': if bpy.context.object.mode != 'WEIGHT_PAINT': bpy.ops.object.mode_set(mode='WEIGHT_PAINT') strokes =[ { "name": "Null", "is_start":True, "location":(0.0, 0.0, 0.0), "size": 1.0, "time":0.0, "pressure": 0.0, "pen_flip":False, "mouse":(0.0, 0.0) },] bpy.ops.paint.weight_paint(stroke= strokes, mode='NORMAL') ``` why emulating weight paint stroke fails?
Member

if it can't be fixed than I would like to know how to emulate texture paint stroke.
I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera.

The following should work similarly to sculpt (in terms of OperatorStrokeElement), no?

https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint
https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint

I tried this one but it won't work.
I get this error
RuntimeError: Operator bpy.ops.paint.weight_paint.poll() failed, context is incorrect

import bpy

for a in bpy.context.screen.areas:
    if a.type == 'VIEW_3D':
        if bpy.context.object.mode != 'WEIGHT_PAINT':
            bpy.ops.object.mode_set(mode='WEIGHT_PAINT')

            strokes =[ {
              "name": "Null",
              "is_start":True, 
              "location":(0.0, 0.0, 0.0),
              "size": 1.0,
              "time":0.0,
              "pressure": 0.0,
              "pen_flip":False,
              "mouse":(0.0, 0.0) 
            },]

            bpy.ops.paint.weight_paint(stroke= strokes, mode='NORMAL')

why emulating weight paint stroke fails?

Could you open a separate report for this? (makes more sense to handle this isolated from this issue). Feel free to ping me already in the new report, thx in advance!

> > > if it can't be fixed than I would like to know how to emulate texture paint stroke. > > > I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera. > > > > The following should work similarly to sculpt (in terms of `OperatorStrokeElement`), no? > > > > https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint > > https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint > > I tried this one but it won't work. > I get this error > RuntimeError: Operator bpy.ops.paint.weight_paint.poll() failed, context is incorrect > ``` > import bpy > > for a in bpy.context.screen.areas: > if a.type == 'VIEW_3D': > if bpy.context.object.mode != 'WEIGHT_PAINT': > bpy.ops.object.mode_set(mode='WEIGHT_PAINT') > > strokes =[ { > "name": "Null", > "is_start":True, > "location":(0.0, 0.0, 0.0), > "size": 1.0, > "time":0.0, > "pressure": 0.0, > "pen_flip":False, > "mouse":(0.0, 0.0) > },] > > bpy.ops.paint.weight_paint(stroke= strokes, mode='NORMAL') > ``` > why emulating weight paint stroke fails? Could you open a separate report for this? (makes more sense to handle this isolated from this issue). Feel free to ping me already in the new report, thx in advance!

if it can't be fixed than I would like to know how to emulate texture paint stroke.
I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera.

The following should work similarly to sculpt (in terms of OperatorStrokeElement), no?

https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint
https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint

I tried this one but it won't work.
I get this error
RuntimeError: Operator bpy.ops.paint.weight_paint.poll() failed, context is incorrect

import bpy

for a in bpy.context.screen.areas:
    if a.type == 'VIEW_3D':
        if bpy.context.object.mode != 'WEIGHT_PAINT':
            bpy.ops.object.mode_set(mode='WEIGHT_PAINT')

            strokes =[ {
              "name": "Null",
              "is_start":True, 
              "location":(0.0, 0.0, 0.0),
              "size": 1.0,
              "time":0.0,
              "pressure": 0.0,
              "pen_flip":False,
              "mouse":(0.0, 0.0) 
            },]

            bpy.ops.paint.weight_paint(stroke= strokes, mode='NORMAL')

why emulating weight paint stroke fails?

Could you open a separate report for this? (makes more sense to handle this isolated from this issue). Feel free to ping me already in the new report, thx in advance!

Separate report for this python script? isn't it just simply I misunderstand python format of texture paint stroke? Or is it simply a glitch that needs to be reported? If it is a glitch I will report.

> > > > if it can't be fixed than I would like to know how to emulate texture paint stroke. > > > > I would like to pass Edit mode's selected vertex position to paint mode and just click the vertex before rotating camera. > > > > > > The following should work similarly to sculpt (in terms of `OperatorStrokeElement`), no? > > > > > > https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.image_paint > > > https://docs.blender.org/api/4.2/bpy.ops.paint.html#bpy.ops.paint.weight_paint > > > > I tried this one but it won't work. > > I get this error > > RuntimeError: Operator bpy.ops.paint.weight_paint.poll() failed, context is incorrect > > ``` > > import bpy > > > > for a in bpy.context.screen.areas: > > if a.type == 'VIEW_3D': > > if bpy.context.object.mode != 'WEIGHT_PAINT': > > bpy.ops.object.mode_set(mode='WEIGHT_PAINT') > > > > strokes =[ { > > "name": "Null", > > "is_start":True, > > "location":(0.0, 0.0, 0.0), > > "size": 1.0, > > "time":0.0, > > "pressure": 0.0, > > "pen_flip":False, > > "mouse":(0.0, 0.0) > > },] > > > > bpy.ops.paint.weight_paint(stroke= strokes, mode='NORMAL') > > ``` > > why emulating weight paint stroke fails? > > Could you open a separate report for this? (makes more sense to handle this isolated from this issue). Feel free to ping me already in the new report, thx in advance! Separate report for this python script? isn't it just simply I misunderstand python format of texture paint stroke? Or is it simply a glitch that needs to be reported? If it is a glitch I will report.
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#121206
No description provided.