Read Physics type from KX_GameObject #35680
Labels
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
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#35680
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
%%%Adds a physics_type attribute to KX_GameObject
Adds Physics enums to bge.logic
KX_PHYSICS_STATIC
KX_PHYSICS_ACTOR
KX_PHYSICS_SENSOR
KX_PHYSICS_ACTOR_SENSOR
%%%
Changed status to: 'Open'
#40341 was marked as duplicate of this issue
%%%You've documented the new constants, but didn't document the new KX_GameObject.physics_type attribute. Also, despite the existing inconsistencies, physics_type should probably be physicsType. Can a game object actually have a type of KX_PHYSICS_ACTOR_SENSOR? I'm also not entirely sold on the KX_PHYSICS_* prefix either (it would seem like we'd want to use this for something else), however, I cannot think of a better prefix off hand.%%%
%%%I've added a new patch with the documentation fixed. I've renamed it to physicsType (not sure why it wasn't before!).
Objects can be ACTOR_SENSOR - this denotes SENSOR objects which detect actors. It could be renamed to SENSOR_DETECT_ACTORS if needs be.%%%
%%%Can we determine if an object is set to No Collision? It would be nice if this property returned similar results to that of bpy: http://www.blender.org/documentation/blender_python_api_2_67_1/bpy.types.GameObjectSettings.html#bpy.types.GameObjectSettings.physics_type%%%
%%%Made modifications as requested. Now we don't use the ClientObjectInfo struct, but instead handle the mapping in scene conversion.%%%
%%%I'm starting to wonder if this is something we want to actually have go through the physics module instead of KX_GameObject. Something like:
constraint.getPhysicsType(gameobj)
It's more round-about, but it also keeps physics settings out of KX_GameObject.%%%
%%%If that was the case, I'd be much happier if we renamed constraints to physics, because it really is much more than just constraints. I've just had a thought (I'm away from home) in how would LibLoaded objects interact with scene conversion (I presume rarely)?%%%
New file fixes ugly code from before (we can just make use of blenderobject->body_type), and ensures all objects (not just physics objects) are considered.
Also includes isActor and isGhost.
Renames record_animation to recordAnimation to keep style conventions.
Yes, ideally we wouldn't deal with a convoluted KX_GameObject namespace, but that is a more fundamental engine design issue, in my opinion. Per your suggestion, we might as well move all physics information, which would not be convenient. Instead, the best solution would be to group this data on the object, but then we're looking and components, aren't we! :)
Added subscriber: @raco
Just a suggestion. I know you guys put a lot attention to this already, but I would prefer a different design/approach.
Of course, these attributes shouldn't be limited to read-only. So, for example, it's possible to set KX_GameObject.physics_type to 'NO_COLLISION' instead of replacing the mesh.
I wish to add:
Added subscriber: @mahalin
Added subscriber: @solarlune
Added subscriber: @brita
Added subscriber: @JacobMerrill-1
◀ Merged tasks: #40341.
@AngusHollands-4 can you get this in a phabricator diff?
Added subscriber: @Blendify
Any way on updating this for the current master if not we can archive this patch?
Removed subscriber: @mahalin
Added subscriber: @mont29
Changed status from 'Open' to: 'Archived'
Archiving for now, we can always reopen should the requested points be addressed/answered.