Python: frame_set skips frame -1; frame_set(n) sets to frame n-1 for (only) negative number n, and sets to frame n for non-negative number n. #41550

Closed
opened 2014-08-24 02:53:26 +02:00 by Tom Benedett · 5 comments

System Information
Windows 7 64-bit, GTX 580

Blender Version
Broken: BuildBot 2.71 revision ea07d93 (August 18th, 2014), at least all the way back to the beginning of July.

Short description of error

Run a little Python script like this:

import bpy
bpy.context.scene.frame_set(-1)

What frame does that set the scene to? You'd think it would be frame -1, but instead it's frame -2! If you enter any negative number n into frame_set(), it will set the scene to frame n-1. If you enter any non-negative number nn into frame_set, it will set the scene to frame nn.

I've been able to set the frame to -1 only by doing this:

bpy.context.scene.frame_set(-1,subframe=0.5)

But I don't think that's how it's supposed to work.

Exact steps for others to reproduce the error
This (frame_set_skips_frame_-1.blend) file contains this code:

import bpy
- bpy.context.scene.frame_set(2) #This gives frame 2
- bpy.context.scene.frame_set(1) #This gives frame 1
- bpy.context.scene.frame_set(0) #This gives frame 0
- bpy.context.scene.frame_set(-1) #This gives frame -2
- bpy.context.scene.frame_set(-2) #This gives frame -3
- bpy.context.scene.frame_set(-1,subframe=0.5) #This gives frame -1

Uncomment any one of the lines and verify that the frame that the scene was set to matches the end-of-line comment's predictions.

**System Information** Windows 7 64-bit, GTX 580 **Blender Version** Broken: BuildBot 2.71 revision ea07d93 (August 18th, 2014), at least all the way back to the beginning of July. **Short description of error** Run a little Python script like this: ``` import bpy bpy.context.scene.frame_set(-1) ``` What frame does that set the scene to? You'd think it would be frame -1, but instead it's frame -2! If you enter any negative number *n* into frame_set(), it will set the scene to frame *n*-1. If you enter any non-negative number *nn* into frame_set, it will set the scene to frame *nn*. I've been able to set the frame to -1 only by doing this: bpy.context.scene.frame_set(-1,subframe=0.5) But I don't think that's how it's supposed to work. **Exact steps for others to reproduce the error** This ([frame_set_skips_frame_-1.blend](https://archive.blender.org/developer/F106431/frame_set_skips_frame_-1.blend)) file contains this code: ``` import bpy - bpy.context.scene.frame_set(2) #This gives frame 2 - bpy.context.scene.frame_set(1) #This gives frame 1 - bpy.context.scene.frame_set(0) #This gives frame 0 - bpy.context.scene.frame_set(-1) #This gives frame -2 - bpy.context.scene.frame_set(-2) #This gives frame -3 - bpy.context.scene.frame_set(-1,subframe=0.5) #This gives frame -1 ``` Uncomment any one of the lines and verify that the frame that the scene was set to matches the end-of-line comment's predictions.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @moak

Added subscriber: @moak

This issue was referenced by blender/blender@9541f75200

This issue was referenced by blender/blender@9541f75200a3aa7c72244c0efa6eddc17664c1e1
Bastien Montagne self-assigned this 2014-08-24 09:00:38 +02:00

Odd, seems to have been introduced on purpose in blender/blender@94cb20ff4e, but no explanation at all about that… Will revert for now.

Odd, seems to have been introduced on purpose in blender/blender@94cb20ff4e, but no explanation at all about that… Will revert for now.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
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-addons#41550
No description provided.