Results 1 to 16 of 16
  1. #1
    Member Nutti's Avatar
    Join Date
    Sep 2014
    Location
    (x, y, z) / Colorful Pico
    Posts
    262

    Fake bpy modules (For Code Auto-completion on IDE)

    Hi,

    Blender does not python API as python files, so only few APIs can be completed code automatically by IDE (PyCharm, Eclipse).
    Therefore, I made a fake python modules for a code auto-completion on IDE.

    https://github.com/nutti/fake-bpy-module

    Supported Blender Version: 2.79

    If you want to try the fake modules, copy whole files on https://github.com/nutti/fake-bpy-mo...r/modules/2.79 to your project directory.

    I will show you an example in PyCharm.

    twi_20171028.png

    Any requests and comments are welcome.

    Have a fun for bpy coding!!



  2. #2
    You're so awesome for this.

    In Pycharm you can add it as a "Path For The Selected Interpreter", so you don't have to copy folder to your project directory.
    Last edited by cmomoney; 27-Oct-17 at 22:37.
    "Yeah, well, some people meditate, some people get massages. I blend." -Will Smith in Enemy of the State
    AddOn:MatCap Pro



  3. #3
    Member rombout's Avatar
    Join Date
    May 2011
    Location
    Curaçao
    Posts
    1,150
    Does this work with Brackets?

    Do i need to follow the steps in the gitHub page and then add "from gen.py import * orso? Not sure what to do with the gen.py file



  4. #4
    No homo, but I love you...
    Currently working on my game idea, modeling all day long, not a bad life.
    Check out my 3D models on TurboSquid: http://www.turbosquid.com/Search/Art...ral=antoni4040



  5. #5
    Interesting addon(?)! It seems like there's some stuff missing though, like scene, data, things under context.



  6. #6
    Member Nutti's Avatar
    Join Date
    Sep 2014
    Location
    (x, y, z) / Colorful Pico
    Posts
    262
    @cmomoney

    Thanks.
    You are right.


    @rombout

    sorry, the procedure in GitHub is for module generation.
    if you want to fake bpy module, you only need to add modules on https://github.com/nutti/fake-bpy-mo...r/modules/2.79 to the path on IDE's project .


    @antoni4040

    you are welcome


    @Cyaoeu

    ah..., you are right.
    but we can not get these things from Blender's documentation.
    If there is idea to get them, please tell me...



  7. #7
    Originally Posted by Nutti View Post
    @Cyaoeu

    ah..., you are right.
    but we can not get these things from Blender's documentation.
    If there is idea to get them, please tell me...
    Yeah I'm not sure either. Besides it's pretty obvious that stuff like context won't work because there's no Blender scene anyway. :P Still it would be interesting if you could "fake" objects too. But I guess I do things like this in the python console anyway (and then copy paste) so it doesn't matter too much.



  8. #8
    Member Nutti's Avatar
    Join Date
    Sep 2014
    Location
    (x, y, z) / Colorful Pico
    Posts
    262
    @Cyaoeu

    yes, it's future tasks about it.
    Anyway, thanks for your pointing out.



  9. #9
    Member rombout's Avatar
    Join Date
    May 2011
    Location
    Curaçao
    Posts
    1,150
    I will need to dive into this and see if this is helpfull.

    I dont compelte understand what the benefit of this addon is. Does this addon autocomplete you code in PyCharm and also check for possible errors in the code and functions, classes etc etc?



  10. #10
    Member Nutti's Avatar
    Join Date
    Sep 2014
    Location
    (x, y, z) / Colorful Pico
    Posts
    262
    @rombout

    I dont compelte understand what the benefit of this addon is
    No, it is not add-on.
    it is modules for only add-on developers.

    we can auto-complete add-on codes in PyCharm or VSCode.
    I was in trouble about that there is no module which can auto-complete bpy code.
    so, i use this modules for auto-completion and make the development faster.



  11. #11
    Member pitiwazou's Avatar
    Join Date
    Jul 2013
    Location
    France
    Posts
    2,913
    We did something similar !



    Pycharm is really great with template and auto complete !



  12. #12
    Originally Posted by pitiwazou View Post
    We did something similar !

    Pycharm is really great with template and auto complete !
    Thanks, this worked great. Would have been easier with an english video though.



  13. #13
    Member Nutti's Avatar
    Join Date
    Sep 2014
    Location
    (x, y, z) / Colorful Pico
    Posts
    262
    @pitiwazou

    nice tutorial !!
    my module can be adapted same way



  14. #14
    Member rombout's Avatar
    Join Date
    May 2011
    Location
    Curaçao
    Posts
    1,150
    I got it working now using Pitiwazou method. Quite nice actually, no i need to get used to PyCharm, i used brackets always. So i need to check how i can get my colors the same to that theme. Im almost there but some parts wont color.



  15. #15
    Member pitiwazou's Avatar
    Join Date
    Jul 2013
    Location
    France
    Posts
    2,913
    Love Pycharm, templates makes life so easy !

    I use Script Watcher addon to update in blender on single file addons, don't really work on multi files addons.
    F8 works too but we have a lot of error messages from other addons.

    3 solutions :

    1 - Restart blender
    2 - Use script watcher or F8
    3 - Use F8 on clean blender with no addons



  16. #16
    Member rombout's Avatar
    Join Date
    May 2011
    Location
    Curaçao
    Posts
    1,150
    Yea i noticed the error with script watcher. I got a addon which consist of multiple script, this causes for errors about some script which cant load. So i guess im back at using F8, also causes errors sometimes for km stuff. So restart is only option. Was always working like that so i had hoped this would work.

    I need to start learning about all them plint and pep8 warning, its looks messy due to that. Some of those warnings arent relevant i guess



Posting Permissions

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