python addobject #40097

Closed
opened 2014-05-08 16:53:20 +02:00 by castanier · 23 comments

System Information
windows 7 nvidida 560 ti

Blender Version
2.70 a

function: scene.addObject (object, other, time = 0) does not create object
and produces no error console

code:

from bge import logic as gl

rainObj = gl.getCurrentController().owner

new = gl.getCurrentScene().addObject("rain",rainObj,70)
new.position = [0.0, 0.1, 0.6]

**System Information** windows 7 nvidida 560 ti **Blender Version** 2.70 a function: scene.addObject (object, other, time = 0) does not create object and produces no error console code: from bge import logic as gl rainObj = gl.getCurrentController().owner new = gl.getCurrentScene().addObject("rain",rainObj,70) new.position = [0.0, 0.1, 0.6]
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @moaaa_user

Added subscriber: @moaaa_user

Added subscriber: @Moguri

Added subscriber: @Moguri

I cannot reproduce the bug (KX_Scene.addObject() appears to be working fine). Please supply a blendfile demonstrating the problem. I've attached the file I'm using, which works correctly for me.

addobject_test.blend

I cannot reproduce the bug (KX_Scene.addObject() appears to be working fine). Please supply a blendfile demonstrating the problem. I've attached the file I'm using, which works correctly for me. [addobject_test.blend](https://archive.blender.org/developer/F87952/addobject_test.blend)
Author

I'll put the piece of code that I have always used

I'll put the piece of code that I have always used

Added subscriber: @solarlune

Added subscriber: @solarlune

Maybe you could provide a blend file of your own that provides the problem, as the code itself doesn't do much.

Maybe you could provide a blend file of your own that provides the problem, as the code itself doesn't do much.
Author

the code is in exemple blend file look my last comment

the code is in exemple blend file look my last comment

Ah, I see. Thank you.

However, this isn't a bug at all - it's just a user error.

The rain object in your example was set to Billboard, and you had the front of the plane facing -X, The front face should face +X. Since the material had backface culling enabled and Billboard was on, Blender was turning the back (invisible) face to the camera (which it should have been doing).

Solution: Rotate the rain object plane 180 degrees in edit mode, or disable back-face culling in the material options.

Something that could have helped you see what was going on:

You could enable static physics on the rain objects and turn on physics visualization, or attach a Python controller and print out a statement to ensure they're being created.

Please ask for help on the BlenderArtists forums to ensure everything is working correctly on your end before reporting possible bugs to help save resources in the future.

Ah, I see. Thank you. However, this isn't a bug at all - it's just a user error. The rain object in your example was set to Billboard, and you had the front of the plane facing -X, The front face should face +X. Since the material had backface culling enabled and Billboard was on, Blender was turning the back (invisible) face to the camera (which it should have been doing). Solution: Rotate the rain object plane 180 degrees in edit mode, or disable back-face culling in the material options. Something that could have helped you see what was going on: You could enable static physics on the rain objects and turn on physics visualization, or attach a Python controller and print out a statement to ensure they're being created. Please ask for help on the BlenderArtists forums to ensure everything is working correctly on your end before reporting possible bugs to help save resources in the future.
Author

sorry

as file work perfectly in the three latest version of blender.

I can not think of anything other than a bug

sorry as file work perfectly in the three latest version of blender. I can not think of anything other than a bug

I believe the requirement for Billboard and Halo was changed between those versions from the face needing to face -X to +X intentionally. Anyway, no problem. I take it this bug can be closed?

I believe the requirement for Billboard and Halo was changed between those versions from the face needing to face -X to +X intentionally. Anyway, no problem. I take it this bug can be closed?

What version was it first flipped in? 2.70? I'm not seeing anything in the release notes; it would be good if these kind of changes were documented.

What version was it first flipped in? 2.70? I'm not seeing anything in the release notes; it would be good if these kind of changes were documented.

@Moguri - I'm not sure. I think I recall it being a patch from vitorbalbio that was committed somewhat recently (in the past few months), but I'm only able to turn up a patch from October that was committed but then reverted. If it were committed finally in October, then that would be 2.69, I think.

@Moguri - I'm not sure. I think I recall it being a patch from vitorbalbio that was committed somewhat recently (in the past few months), but I'm only able to turn up a [patch from October that was committed but then reverted](http://lists.blender.org/pipermail/bf-blender-cvs/2013-October/059717.html). If it were committed finally in October, then that would be 2.69, I think.

Added subscriber: @JacobMerrill-1

Added subscriber: @JacobMerrill-1

Yeah, it was flipped in 2.7 (I had to flip normals on all halo objects in my game)

Yeah, it was flipped in 2.7 (I had to flip normals on all halo objects in my game)

Added subscribers: @ideasman42, @brecht

Added subscribers: @ideasman42, @brecht

Campbell, Brecht, do either of you know what happened here (why are our halos flipped now)?

Campbell, Brecht, do either of you know what happened here (why are our halos flipped now)?

Added subscriber: @mont29

Added subscriber: @mont29
Member

Added subscriber: @JorgeBernalMartinez

Added subscriber: @JorgeBernalMartinez
Member

Can I close this report?
after 5 releases, It doesn't seem a good idea flip halo normals breaking compatibility again. Then, I propose leave current behaviour as it is and to close the report.

Can I close this report? after 5 releases, It doesn't seem a good idea flip halo normals breaking compatibility again. Then, I propose leave current behaviour as it is and to close the report.

Added subscriber: @panzergame

Added subscriber: @panzergame

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Porteries Tristan self-assigned this 2015-05-23 17:02:44 +02:00

Edit mode -> ctrl + F -> flip normal

Edit mode -> ctrl + F -> flip normal
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
7 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#40097
No description provided.