Example of Collection property definition suggests by the print statement that three values are added while in fact only two are. #48212
Labels
No Label
Meta
Good First Issue
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 & Devices
Module
Python API
Module
Rendering & Cycles
Module
Sculpt, Paint & Texture
Module
User Interface
Module
VFX & Video
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Information 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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-manual#48212
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello there,
I have just started to learn python/blender,
Now, in the following text on a property collection definition, the print statement suggests that three values are added while in fact only two are. Unless I am mistaken, but I don't think so.
kind regards,
Ondrej Popp
https://www.blender.org/api/blender_python_api_2_77_0/bpy.props.html?highlight=property
import bpy
Assign a collection
class SceneSettingItem(bpy.types.PropertyGroup):
bpy.utils.register_class(SceneSettingItem)
bpy.types.Scene.my_settings = \
Assume an armature object selected
print("Adding 3 values!")
my_item = bpy.context.scene.my_settings.add()
my_item.name = "Spam"
my_item.value = 1000
my_item = bpy.context.scene.my_settings.add()
my_item.name = "Eggs"
my_item.value = 30
for my_item in bpy.context.scene.my_settings:
Changed status to: 'Open'
Added subscriber: @OndrejPopp
In addition, the second tupple element in the enum example is all "red", and although this is not important to understand the example, I think maybe the second tupple elements should follow their first one, meaning "Red"/"Green"/Blue"/"Yellow"
test_items = [
This issue was referenced by blender/blender@0b349871d8
Changed status from 'Open' to: 'Resolved'
Added subscriber: @mont29