adding new camera with explicit rotations are not rotated properly #77798

Closed
opened 2020-06-12 14:14:03 +02:00 by Bay Raitt · 5 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.74

Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-04 22:58, hash: c7329da14b
Worked: (newest version of Blender that worked as expected)

Short description of error
api bug. Euler rotations are not being interpretted properly.

Exact steps for others to reproduce the error

bpy.ops.object.camera_add(enter_editmode=False, align='WORLD', location=(0, -12, 1.52), rotation=(90, 0, 0), scale=(1, 1, 1))

note camera is created with x rotation not at 90 degrees and is instead rotated 5156.62d

looks like the euler input values are not being interpreted properly.

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 980/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.74 **Blender Version** Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-04 22:58, hash: `c7329da14b` Worked: (newest version of Blender that worked as expected) **Short description of error** api bug. Euler rotations are not being interpretted properly. **Exact steps for others to reproduce the error** bpy.ops.object.camera_add(enter_editmode=False, align='WORLD', location=(0, -12, 1.52), rotation=(90, 0, 0), scale=(1, 1, 1)) note camera is created with x rotation not at 90 degrees and is instead rotated 5156.62d looks like the euler input values are not being interpreted properly.
Author

Added subscriber: @spiraloid-3

Added subscriber: @spiraloid-3
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Philipp Oeser self-assigned this 2020-06-12 17:31:58 +02:00
Member

Blender is not using Euler but radians in the rotation argument.

Use this instead:

import math
angle=math.radians(90.0)
bpy.ops.object.camera_add(enter_editmode=False, align='WORLD', location=(0, -12, 1.52), rotation=(angle, 0, 0), scale=(1, 1, 1))

This is working as expected, thx reporting, but closing.

Blender is not using Euler but radians in the rotation argument. Use this instead: ``` import math angle=math.radians(90.0) bpy.ops.object.camera_add(enter_editmode=False, align='WORLD', location=(0, -12, 1.52), rotation=(angle, 0, 0), scale=(1, 1, 1)) ``` This is working as expected, thx reporting, but closing.
Author

cheers, thanks for the tip.

might be good to add it to this page or mention that the rotation is in radians,

https://docs.blender.org/api/current/bpy.ops.object.html

cheers, thanks for the tip. might be good to add it to this page or mention that the rotation is in radians, https://docs.blender.org/api/current/bpy.ops.object.html
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#77798
No description provided.