Intellisense for the Text Editor

Thats right. This was personal preference, i mean. The old intellisense takes less space to display results and doesnt cut words. This trades into less scrolling and more readable output. You can make a backup of your current intellisense in case u want it back.

example path for blender intellisense:
D:\Blender Foundation\2.62\scripts\modules\console\intellisense.py -> intellisense.bak

i think i’ve found a bug, when i press enter nothing happend(don’t create a new line), i have to press the numpad enter. maybe a problem with key assignement?
I’m on ubuntu with a french keybord when does it help.

Same problem of kgeogeo, windows7 and italian keyboard

Im sorry, but this script is a first test to implement this functionality. Its very experimental yet.
It assigns return to a new operator of my own that sends lines to the console. If something fails returns doesnt work.
Ill try to make a more stable version.

thanks for your interest.

any updates on a github repo?
currentle I have to learn some python but could help later =)

Hi everyone.

I have uploaded an update for this script.

I have included an operator that reads all the lines and tries to guess their variables.

It doesnt read variables inside functions or classes but we can cheat by creating those at the begining of the script like:

import bpy

context = bpy.context
scn = context.scene
obj = context.object

and so on…

These variables will be avalaible inside any class or function that we might have.

I created an option at Texts properties to quick enable/disable the script.

I have released a new video where u can see how it works and how to install at the main thread.

Hope you like it.
Cya.

Hi Mackraken,
I’ve testet the latest release. It works very good. Unfortunately the bge module does still not work.
I don’t know why… It would be really great if you can add support for the bge module too.

I have noticed, that the bge module can also not be imported from the console. Maybe it is because the bge module runs only when the game engine is started?

I realised that while i was testing. Im not sure where is the bge module or how can i make it work yet, but ill take a look.

it would be awesome if you can solve this problem! This is a really great feature for the texteditor! I really like!

Im afraid i cannot find the bge module anywhere.
If it only exists at runtime is not going to be posible.
If you know anyone who knows how to import the bge module into the console pls let me know.

In the meantime we can cheat like this.

Create a new text file “mybge.py” into “D:\Blender Foundation\2.62\scripts\modules”

Here you can write placeholder classes as the bge has, for example:

mybge.py


class logic():

    def getCurrentController():
        pass

if __name__ == "__main__":
    main()

Then we can start writing our bge script like:

import mybge as bge
#import bge

logic = bge.logic()
cont = logic.getCurrentController()
and we can make use of intellisense using the fake mybge module.
I dont have time to fully write a fake bge module but this can be provisional solution.

If anyone can throw some light here would be great.
Thanks

Hi, Mccracken, I tested it in 269, it works(not bge module, but all the other ones do) but it overrides the enter key by some reason, when I hit “enter” to go to the next row it doesent work. Also, the thing with the old API(2.57), should be updated. Are you still active in coding? I didnt see new things from you for a long time, hope you are well. Can you please update this one? Also, whats up with the library script(it also doesent work for a long time)? Do you plan something on this?

Hello spirt, thanks for asking.

Yes Enter is overriden because the script have to push the line to the console. Its true that if something goes wrong on the key assigment, it doesnt work which is not acceptable. This may be an api change. I will try to have a look.

Ive received some donations for matlib im ill be able to release a new update soon which will include
-multiple libraries. Create or point libraries within the script.
-apply material to selected objects
-apply material in edit mode to selected faces.

  • Option “Always Import”. By default the script wont import a material if its present on your scene. This way you can apply the same material to several objects without making duplicates of that material. This behaviour can be overriden so the script always performs a new import every time.
  • Option to import the material linked
  • Option to append the material instead subst.

Ive also updated Class Viewer. Now you can go to defs inside a class and improved “Go to last error” which now looks for the last error in the traceback which is often the line you want to debug.

@Mackraken
I’ve isolated the Intellisense function from your add-on and updated it to 2.8+ so it could be included in this collection of Text Editor add-ons: https://blenderartists.org/t/how-would-you-show-some-love-for-the-blender-text-editor/1163857 I hope that’s ok?

Download of the 2.8+ version: https://github.com/tin2tin/Intellisense_for_Blender_Text_Editor

2 Likes
  • Change 1

Since blender 3.3, the module folder of the console has been moved.

from
from console import intellisense

to

try:
    from console import intellisense
except ModuleNotFoundError:
    from bl_console_utils.autocomplete import intellisense
  • Change 2(send Console)

Variables were supported in early versions.
It is not perfect, but as an emergency
“CTRL + SHIFT + ENTER” will send the specified line to the console.
the specified line to the console.

I have created a modified version.
You can use it if you like.

How to use?(GIF ANIMATION)

Use Bpy module
Animation

use Send console
4
11

How to use other module
Animation (1)
1

Use python code
2
3

4 Likes

The following features have been added, although they are experimental.
Please use them if you like.

v0.3.3

  1. Add add-on preferences (keymap can be changed).

  1. Add a line break option to the side menu.
  1. Add an operator to output the selected line to the console (CTRL + SHIFT + ALT + ENTER).
    6
    Regarding this feature.
    The regular console and the console used in “send console” are two different consoles.
    If you want to check variables in the Window’s console, you
    variables must also be sent together.
1 Like

A new version has been released.

Other Releases are listed below.

  1. Revisions
    Autocompletion is now available even in the middle of a document.

7

  1. Revisions
    Fixed a strange insertion of a list.

10

  1. Revisions
    Deleted previous operator. I’m sorry to leave behind…

We found a bug.

BTW, there’s a bug in Blender 3.3.
The list of object variables is wrong.
This may be fixed by updating blender…

8
9

If you use variables in objects a lot, I suggest you keep using them in 3.2.

2 Likes

Thank you @makorin … very useful additions.

A missing feature in blender text editor is fold/unfold function/blocks lines… maybe you or someone can add this.

2 Likes

Thank you very much.

I would like that feature too.
With my codding skills it is difficult…
I wish someone would do it.

2 Likes

Fixed for blender 4.0.
Also added the ability to send selected text to the console.
A wiki has also been created for your reference.

1 Like