Python/RNA: Cannot use Step Indice for Slicing #73816

Open
opened 2020-02-14 20:20:23 +01:00 by Spencer Magnusson · 4 comments

System Information
Operating system: Windows 11 Home
Graphics card: NVIDIA GeForce RTX 3060

Blender Version
Broken: Blender 3.6.2, hash e53e55951e.

Short description of error
Cannot slice with step on image pixel data, must put into new array first
Error in System Console:

TypeError: slice indices must be integers or None or have an __index__ method
Error: Python script failed, check the message in the system console

Exact steps for others to reproduce the error
Startup file, make and run the following script

import bpy

orig = bpy.data.images['any_image_file.jpg'].pixels
this_works = orig[0:6]
this_works = this_works[::3]
raises_exception = orig[0:6:3]
**System Information** Operating system: Windows 11 Home Graphics card: NVIDIA GeForce RTX 3060 **Blender Version** Broken: Blender 3.6.2, hash e53e55951e. **Short description of error** Cannot slice with step on image pixel data, must put into new array first Error in System Console: ``` TypeError: slice indices must be integers or None or have an __index__ method Error: Python script failed, check the message in the system console ``` **Exact steps for others to reproduce the error** Startup file, make and run the following script ``` import bpy orig = bpy.data.images['any_image_file.jpg'].pixels this_works = orig[0:6] this_works = this_works[::3] raises_exception = orig[0:6:3] ```

Added subscriber: @SpencerMagnusson

Added subscriber: @SpencerMagnusson
Campbell Barton changed title from Cannot use Step Indice for Slicing to Python/RNA: Cannot use Step Indice for Slicing 2020-02-15 03:45:31 +01:00

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

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

Added subscriber: @ckohl_art

Added subscriber: @ckohl_art
Philipp Oeser removed the
Interest
Python API
label 2023-02-10 09:04:43 +01:00

Still seen in 4.1

Still seen in 4.1
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#73816
No description provided.