I wonder if it's possible to send commands/data from scripts (ex from Text editor) to Blender Python Console? I've enabled a Math Vis Console: it draws provided Vector/Line/Etc data in 3d viewport and it'd being a great help, however it requires data to be typed in Python Console. So for example if I want to display an ob.location I have to

  • print(ob.location) in my script first
  • then copy string from System Console: <Vector (-1.4095, -0.1780, 1.7132)>
  • reformat it as a 'proper' Vector: Vector((-1.4095, -0.1780, 1.7132))
  • paste this along with a variable name (loc) to Python Console: loc = Vector((-1.4095, -0.1780, 1.7132)):

enter image description here

I wonder if there's a faster way of doing that?


You can paste data onto bpy, not sure how advisable it is, but its a technique that works:

In a script:

import bpy

bpy.sergey = (1,2,3)

And then on the console:

>>> bpy.sergey
(1, 2, 3)
  • $\begingroup$ Woah! This works, thank you! $\endgroup$ Aug 12 '20 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.