Page 1 of 8 123 ... LastLast
Results 1 to 20 of 156
  1. #1
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716

    [Addon] Auto Completion in Blenders Text Editor

    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/...-autocomplete/

    Source Code: https://github.com/JacquesLucke/code_autocomplete

    Documentation: http://code-autocomplete-manual.read...est/index.html

    Here are some videos which show different states of development: https://www.youtube.com/watch?v=SOHD...Ou-HxkWj8C-bAK


    [I removed the original first post]
    Last edited by Jacques Lucke; 18-Jan-16 at 12:59.
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  2. #2



  3. #3
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    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.
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  4. #4



  5. #5
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    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
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  6. #6



  7. #7
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    ok. perfect.
    Now it should work without renaming the folder thanks for the report
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  8. #8
    Member Spirou4D's Avatar
    Join Date
    Jul 2010
    Location
    Lille, France
    Posts
    1,268
    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.
    Words are Images that loosed Light!
    Linux Mint 18.2 Saunya - Bi-Quad Intel 2.66Ghz x64Bytes - Nvidia OpenGL GT 630 4Go-vram



  9. #9
    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)?



  10. #10
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    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.
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  11. #11
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    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!

    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  12. #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!



  13. #13
    Member pitiwazou's Avatar
    Join Date
    Jul 2013
    Location
    France
    Posts
    2,916
    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.

    Code:
    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)



  14. #14
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    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.
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  15. #15
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    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:
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  16. #16
    Oh may, that just became even better!

    Have you considered doing this as a Sublime Text add-on?



  17. #17
    Member Jacques Lucke's Avatar
    Join Date
    Oct 2012
    Location
    Berlin, Germany
    Posts
    716
    Originally Posted by JonathanW View Post
    Oh may, that just became even better!
    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/scri...cumentation.py
    Last edited by Jacques Lucke; 02-Dec-14 at 15:16.
    My Projects: Sniper Addon, Animation Nodes, Auto Completion
    You can support me on Patreon.



  18. #18
    Member pitiwazou's Avatar
    Join Date
    Jul 2013
    Location
    France
    Posts
    2,916
    This last update is really great and usefull !



  19. #19
    Member Januz's Avatar
    Join Date
    Oct 2013
    Location
    Buenos Aires, Argentina
    Posts
    189
    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!



  20. #20
    Member tynaud's Avatar
    Join Date
    Aug 2010
    Location
    Bayonne, France
    Posts
    17
    WOuoww yes ! This is really impressive ! Thanks for this :-)



Page 1 of 8 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •