Variables For Scripted Drivers Convert Valid RNA Strings To Floats #26306
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#26306
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?
%%%Hi All,
I am trying to pass the name of the scene as a variable to a function in a scripted expression.
I have created a driver channel.
I have added a new variable named 'scene_name'.
The Prop is the Scene context.
I have chosen the current scene.
The Path is 'name'
This effectively gives a RNA path like bpy.context.scene.name which is a valid string.
However, all that gets passed to the Scripted Expression is a float value of 0.0.
Shouldn't the type of the RNA path be examined and the correct string value be passed to the scripted expression?
If you open up the attached BLEND file and re-activate the scripted expression you will see in the console that the value 0.0 is printed for the scene name (before it errors out). It should have printed "Scene".
Yes, I do realize that the print statement does not return a float value and that is why the Type Error occurs.%%%
Changed status to: 'Open'
%%%This is more of a Todo item that is quite low priority
Nowhere in the rest of the animation system are types that cannot be reasonably and reliably represented numerically used yet. That is, pointers and strings (in particular) cannot be used, as you cannot accurately compress all their information into a numerical value which can later be retrieved and able to be used in many places.
In this particular case, it is possible to add a hack to allow strings/pointers to be passed into scripted expressions, though it would be a bit ugly (though not as ugly as some of the options for hacking support for the other types mentioned above for standard animation).
I believe that this is not something that will really be attempted that much apart from a few specialty cases, so IMO we can postpone adding a hack for this till a later date%%%
Changed status from 'Open' to: 'Archived'