nodes based scripting appears to not respect value of Blender property set in Properties ->Custom Properties
Anniepoo opened this issue · 3 comments
Description
When Krom starts custom Blender object property does not respect set value from properties panel as default
To Reproduce
- Start blender 3.6.5 with SDK23.10.0
- Follow the tutorial at https://www.youtube.com/watch?v=w0vQTVyGCyM to create a simple 1ps camera controller - I named this trait "OnePSLook"
- Create a custom property active_camera, type integer, and value 1 on the 'sphere' object
- Add a second trait "CameraSelect" to the 'sphere' object. Add a Keyboard node and Set Object Property that sets active_camera to 1 when the 1 key is pressed (needs an Integer node for the constant 1)
- Duplicate these nodes and change so typing "2" key changes active_camera to 2
- In OnePSLook add a Gate Node in the output of On Update node that only permits updates if active_camera is equal to 1
- Save file and run in Krom
Expected behavior
Expect game to start in 1ps camera follows mouse mode.
Observed: game starts with no camera motion.
type 1 and camera action starts
Behavior is fixed by adding On Init event that sets active_camera to 1
System
Blender: 3.6.5
Armory: 23.10.0
OS: Ubuntu 22.04.1 LTS Gnome 42.5
Graphics card: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] / Mesa Intel® UHD Graphics (CML GT2)
Test File
(drag & drop the zipped .blend file here)
starter.zip
This file includes the 'fix' - to repro bug, delete On Init and connected Set Object Property nodes
Hi, in your file there is a custom property called camera_select
on the charactercollision
object which is referenced by the CameraSelect
trait, but the OnePSLook
trait instead references the property active_camera
which doesn't exist (thus, Get Object Property
returns null). So I think there is no bug here.
Thanks - new user error, and possibly "Get Object Property" being unclear if it means an Armory property or a Blender property.