API Navigator add-on

Bonjour à tous!

This is my first attempt at publishing an add-on. I call it API Navigator. Its purpose is to speed up the searching through the blender python api. I am still new to programming, so what I was trying to do, is to accelerate my learning. But I think this can be usefull even for advanced script writers.

Here is the link :

http://www.pasteall.org/17192/python
http://www.pasteall.org/pic/show.php?id=7176

What it does :

In the text editor’s properties, a new panel is created called API Navigator. In it, you can browse trough the api tree structure like a file browser. For every tree level, it displays the documentation for the current level in the text area. If too many entries are in the list displayed, you can filter the results(for example, go to bpy.types). There is also an icon selector. (I know another add-on existed to show all icons. it was usefull, but it lags a lot, so it wasn’t a good idea to let it registered.) Now, you can scroll through all icons, when you have made your choice, just click on the icon and its name is copied to the clipboard.

Before getting to the official steps to publish it, I need some feedback from the community. And I also have a nasty bug.

Here is what feedback I’d like from the community:

  • What do you think of this add-on. Is it missing something that should be there in your opinion? Will you use it? Your impressions…
  • How do I get rid of my crash? How do I unregister the script?
  • Are the names used to explain the properties easily understandable. Are they correct according to the programming principles?(I am autodidact, so if I’m wrong, I hope someone will tell me)

Explanation about the bug:

When registering the script like any add-ons(copying the script in the add-ons folder and activating it in the user properties), it works correctly. The problem occurs when unregistering it. In a console editor, writing :
>>> bpy.context.scene.

and autocompleting the line(ctrl+space) crashes blender. I don’t know what happens. I think I am not unregistering the script correctly but don’t know what I’m doing wrong.:confused:

Thank you for any feedback. I hope every script writers will find it usefull.
:smiley:

put this in your unregister function:

import bpy
del bpy.types.Scene.api_nav_props

that gets rid of your crash

@testscreenings
Thank you very much. It solves the problem.

@everyone
Now the pasteall version is updated. The bug is gone, but if you find another one, please let me know.

hi, this looks really cool!
it will be a handy tool.
your welcome to start the official process now by requesting to join here:
http://projects.blender.org/projects/bf-extensions/
then you could create a page for your script in the upload section to develop it further.

I’m really very sorry, due to a problem with another dev, he has mistreated your script.
the end result is I have quit as a Blender dev.
sorry, hopefully the next guy will be more friendly.

Hi Axon D,

You’re welcome to upload your script on our Upload trackers! :slight_smile:

Have a read at
wiki.blender.org/index.php/Dev:Py/Sharing

Please follow these guildelines when documenting your addon:
wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons

If your script has “wiki_url” and “tracker_url” in bl_addon_info and get some good review, it can go in svn, first contrib/ directory then possibly trunk/.

Thanks!

Hi Axon D,

You’re welcome to upload your script on our Upload trackers! :slight_smile:

Have a read at
wiki.blender.org/index.php/Dev:Py/Sharing

Please follow these guildelines when documenting your addon:
wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons

If your script has “wiki_url” and “tracker_url” in bl_addon_info and get some good review, it can go in svn, first contrib/ directory then possibly trunk/.

Thanks!

Hi Axon D,

You’re welcome to upload your script on our “Upload” trackers!
Have a read at the guides linked at the beginning of the 2.5 scripts catalog in wiki
(I tried replying a couple of times before, but posting 2 links cuts the reply I guess, weird)

If your script has wiki_url and tracker_url fields properly filled in bl_addon_info and get a good review, it can go in svn, first contrib/ directory then possibly trunk/.

Also, feel free to come in #blenderpython in IRC to discuss any doubts.

Thanks!

@Meta-Androcto Hi! I’m not quite sure of what happened. Anyway, I did re-pasted the script in its more recent form.

the end result is I have quit as a Blender dev.
Are you saying that you are not any more a blender dev for what did happen? I hope it’s not the case. If it is, could you give me some informations of what occured related to my script. I feel very embarassed by the situation.

@minDrones Thank you for the repply. I know that I need a wiki page and a tracker_url. What I thought was to get as more feedback as possible before proceeding to the official steps. But as can I see, it is preferable to go by the book from the start, and get feedback at this point. This is what I’m going to do.

(I tried replying a couple of times before, but posting 2 links cuts the reply I guess, weird)
For myself, refreshing the blenderartists pages is very long, and I often loose functionality of the editing buttons. I think that blenderartists has some problems right now. Is it doing the same for you?

Here is the latest version :

http://www.pasteall.org/17210/python

I still have a bug for registering. I don’t know exactly what I am doing wrong. If I save the user preferences with the addon activated, restarting blender gives an error. The registering is not correct. And even more. If I activate it, then deactivate it, and reactivate it, going in the text editor to look at the panel crashes blender.

If someone can help me it would be very appreciated.
thanks.

The crash problem is too in W32 Vista SVN 33437 …

!!Oo!! i’m dying man !
what’s a super-toolbox ! i found it so …so excellent project !
thanks…a lot of thanks for that script…hope to see a new version soon…i can’t help at this level but it seems dedicated to a good future !

:smiley:

Hi!

Concerning the icon scroller, it is now in system_icon_get.py, an addon mostly written by Crouch. His approach and mine have been merged together. It is still currently in my script, but most probably will not stay there. I am not fixed on how the script will evolve.

The last revision of the script may be found on this page https://projects.blender.org/tracker/?func=detail&aid=24982&group_id=153&atid=467

Right now, I have a problem and need some help : I have a PointerProperty and have problems re-registering it. I think that the problem is the unregistering.

Is someone know how to unregister correctly a PointerProperty? I think they need to be unregistered differently than other properties.

Thank you!

Axon D: The tracker is giving me problems (can’t post on it), so I’m posting here.

About the re-registering: you’re initiating properties in prop_def() but that function is only called when running the entire script file. This only happens when Blender enables the script the first time. The second time it’s enabled it only add the classes again and runs the register() function. So your properties (and more importantly the struct types) aren’t re-initiated. You can solve this by relocating the prop_def() call to the register() function. This stops the script from crashing. On re-enabling you still need to press the enable button twice, and you get some errors in the console, but I’m not certain that’s specifically related to this script, as I’m having that problem with some of my own scripts as well.

About the icons part: I’ve updated my script and done some additional cleaning. Changes compared to the latest pasteall version you added to the tracker:

  • icon_list is not a global anymore, but created on initialisation of the classes
  • small changes in the layout (columns and wrong alignments made icons jump around)
  • remove entry from console menu on unregistering, instead of adding it again

It’s in SVN right now. Thanks for the help.

I’ve also talked to Mindrones and he had a suggestion that might be a good solution: have the icons script as a separate add-on and the api-navigator can load the icons module, so it can include the icons functionality. That way people who just want the icons can do so by only enabling the icons add-on, while people who enable the api-navigator add-on don’t have to miss the icons part.
This also prevents potential problems when people enable both add-ons and they would both have separate code for the icons part (name clashing and all kind of ugly things).
Let me know what you think of it.

Close to final revision

@Crouch
Sorry for the delay. Now most of the problems on my script are solved. Thank you for all your help. I learned a lot from that collaboration. I am gratefull to thee. And I totally agree with the idea of letting the icon script as a saperate addon. In the current version of my script, I removed it. Now, people can work with one addon and the other closed and vice versa. It is more flexible this way.

@Community
Now here is what it looks like.
http://www.pasteall.org/pic/show.php?id=7492

And here is the wiki page for the script. You can get it from there:
http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Text_Editor/API_Navigator

This is a major change from the last version.

  • The UI has been improved for reading
  • Moved Type report and Return report to the text area(this way it’s easy to copy)
  • The lists are now sensitive to object types and organized relating to this estimation
  • The doc text can be toggled on and off by pressing Escape key (but the key map seems to be overwritten at startup. F8 and it’s ok)

It is certainly not perfect, but I think it will be very usefull. I might have to check at pep-8 compliancy. I don’t know exactly what it is but I’ll have a look.

If people see things in my script that shouldn’t be this way, please give me some feedback explaining me what is wrong or how it could be improved. I hope to learn as much as possible. For example, what would you add to the report text area.

Thanks to everyone!
Bye!

http://wiki.blender.org/index.php/File:API_Navigator0.9.pnghttp://wiki.blender.org/index.php/File:API_Navigator0.9.png

Thanks for this Incredible useful tool.

I was using the python console but your script shows much more info.

Thank you Bao2, it’s a pleasure to hear that it is appreciated.

Now I’m looking at changing the name for something more representative. And I would like to hear what people think of it.

I have some suggestions :

  • API Tree
  • Python API
  • API

And if you have any suggestions, please let me know.

Thank you!

Api visual (in text window) ?

Hi fantastic tool.

Two questions… maybe slightly off topic.

Could this be someway synced with the outliner in datablock view. And secondly the autocomplete feature… could this be incorporated into the text editor.

@batFINGER
Hi! thank you for your feedback.

Could this be someway synced with the outliner in datablock view.
In fact, I don’t think that they share the same tree at all. Some parts may be the same, but I don’t think that they represent the same thing. Actually, I don’t even know what the Datablock outliner is really used for. I don’t use it.

For the autocompletion, I began to look at something. This could bring a lot to this script and be very usefull. But this is totally different feature. My script does not autocomplete right now. It only lists the children of an object in the tree. If you don’t have the complete name, it will evaluates it as a string and will list the attributes and methods of a string.

As I said, I began to work on autocompletion, but this might take a while. I am still a beginner in code programming and API Navigator is the more comlex code I have written by now.