This is the official thread for the Code Autocomplete addon.
You can buy it in the BlenderMarket but it is also freely available on github.
Buying the addon entitles you to better support when you have questions and helps to ensure that I can continue working on my addons!
BlenderMarket: https://cgcookiemarkets.com/blender/all-products/code-autocomplete/
Source Code: https://github.com/JacquesLucke/code_autocomplete
Documentation: http://code-autocomplete-manual.readthedocs.org/en/latest/index.html
Here are some videos which show different states of development: https://www.youtube.com/watch?v=SOHDpTfdQ6E&index=1&list=PLFSQhJg6cGLKp4eHEMMOu-HxkWj8C-bAK
[I removed the original first post]
1 Like
Thanks
I hope I can make it much easier to make custom panels, operators, menus, ⌠without having to remember all those small code snippets which are always the same.
pitiwazou
(Pitiwazou)
November 30, 2014, 2:53am
4
I have this error when activating the Adoon.
Ahh I tested this on another computer and found the reason for this error.
Can you maybe remove â-masterâ from the name of the folder you copied in the addon directory?
This should help.
I will try to find a way around that
pitiwazou
(Pitiwazou)
November 30, 2014, 3:10am
6
Iâts working without the -master ^^
ok. perfect.
Now it should work without renaming the folder thanks for the report
Spirou4D
(Spirou4D)
November 30, 2014, 3:39am
8
Ho la la I donât know what to say! Amazing I wait for it a long time agoâŚ
Very good Jacques, I applaud with both hands, Congratulations.
Awesome! I saw the video you released yesterday and Iâve been waiting to be able to test it out.
Is this like a continuous mode? Maybe there should be the option to use CTRL spacebar or TAB to mimic the python console or the terminal (linux)?
what do you mean with continuos mode?
I donât know how I can mimic the console.
At first I will clean the code up now and make it more extendable. Then I plan to implement more of those small code templates and some better word suggestions after words like âcontextâ, âdataâ, etc.
The addon has much better suggestions now, but see yourself
This isnât in master yet but will be soon. See how much faster you can write your own tools with Auto-Completion!
JonathanW
(Jonathan Williamson)
December 1, 2014, 8:48am
12
This is fantastic! I wonât comment too much, since Iâm one of the contest judges, but I would just like to say that this is a great example of improving workflows with add-ons!
pitiwazou
(Pitiwazou)
December 1, 2014, 8:56am
13
Yes, this is really great !
Lapineige has made some great code for the text editor to comment easilly, maybe you can add something like that.
import bpy
from re import search
from bpy.types import Menu
def changeText(self,context):
bpy.context.space_data.text = bpy.data.texts[bpy.context.scene.tmp_text]
bpy.types.Scene.tmp_text = bpy.props.EnumProperty(items = [(txt.name,txt.name,'','',bpy.data.texts.find(txt.name)) for txt in bpy.data.texts], update=changeText)
class TextEditorPie(Menu):
# label is displayed at the center of the pie menu.
bl_label = "Text Editor Pie"
bl_idname = "text.text_editor_pie"
@classmethod
def poll(cls, context):
return context.space_data.type == 'TEXT_EDITOR'
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
pie.operator('text.unindent',icon='BACK')
pie.operator('text.better_indent',icon='FORWARD', text='Indent')
pie.prop(context.space_data, 'show_word_wrap', text='Wrap')
pie.operator('text.run_script',icon='PLAY')
pie.operator('text.better_uncomment',icon='VISIBLE_IPO_OFF', text='Uncomment')
pie.operator('text.better_comment',icon='VISIBLE_IPO_OFF', text='Comment')
pie.operator('text.select_line',icon='BORDER_RECT')
pie.menu(menu='text.text_list_menu', text='Choose Text')
class TextsList(bpy.types.Menu):
bl_label = "Texts List"
bl_idname = "text.text_list_menu"
def draw(self, context):
layout = self.layout
layout.props_enum(context.scene,'tmp_text')
class BetterComment(bpy.types.Operator):
""" """
bl_idname = "text.better_comment"
bl_label = "Better Comment"
def execute(self, context):
base = context.space_data.text.current_line.body
bpy.ops.text.comment()
if context.space_data.text.current_line.body == base:
context.space_data.text.current_line.body = '#' + context.space_data.text.current_line.body
return {'FINISHED'}
class BetterUnComment(bpy.types.Operator):
""" """
bl_idname = "text.better_uncomment"
bl_label = "Better Uncomment"
def execute(self, context):
base = context.space_data.text.current_line.body
bpy.ops.text.uncomment()
if '#' in base:
if context.space_data.text.current_line.body == base and search(r'[^#]', base).start() > base.index('#'):
context.space_data.text.current_line.body = base[search(r'[^#]', base).start():]
return {'FINISHED'}
class BetterIndent(bpy.types.Operator):
""" """
bl_idname = "text.better_indent"
bl_label = "Better Indent"
def execute(self, context):
base = context.space_data.text.current_line.body
bpy.ops.text.indent()
if search(r'[^ ]', context.space_data.text.current_line.body).start() == search(r'[^ ]', base).start():
context.space_data.text.current_line.body = ' '*context.space_data.tab_width + base
return {'FINISHED'}
def register():
bpy.utils.register_class(TextEditorPie)
bpy.utils.register_class(TextsList)
bpy.utils.register_class(BetterComment)
bpy.utils.register_class(BetterUnComment)
bpy.utils.register_class(BetterIndent)
def unregister():
bpy.utils.unregister_class(TextEditorPie)
bpy.utils.unregister_class(TextsList)
bpy.utils.unregister_class(BetterComment)
bpy.utils.unregister_class(BetterUnComment)
bpy.utils.unregister_class(BetterIndent)
if __name__ == "__main__":
register()
bpy.ops.wm.call_menu_pie(name=TextEditorPie.bl_idname)
Thanks Jonathan. Its really motivating to hear that from you
@pitiwazou : thanks for that code. I will see what I can do with that, but my main focus is auto completion atm.
Today I worked on a cool class that allows high level access to Blenders python api directly in Blender.
Here is what is possible so far:
JonathanW
(Jonathan Williamson)
December 2, 2014, 11:42am
16
Oh may, that just became even better!
Have you considered doing this as a Sublime Text add-on?
Otherwise it wouldnât make sense a guess
not really. I never worked with Sublime. Also the addon reads the api in Blender on the fly. This isnât an extra file. So I think it would be harder to implement this in another application
[Edit]ok, exporting all api data shouldnât be very hardâŚ[/Edit]
https://github.com/JacquesLucke/script_auto_complete/blob/api/documentation.py
pitiwazou
(Pitiwazou)
December 2, 2014, 12:19pm
18
This last update is really great and usefull !
Januz
(Diego Gangl)
December 2, 2014, 1:13pm
19
This is insanely cool, it even looks more solid than the autocomplete in some IDEs :P.
The text editor really needed some love, great work!
tynaud
(tynaud)
December 2, 2014, 1:56pm
20
WOuoww yes ! This is really impressive ! Thanks for this