BlenderSublime : Develop with Sublime Text 3 as an external script editor.
An interactive bridge between Sublime and Blender. To improve the quality of development
BlenderSublime allows you to develop, execute and debug straight from Sublime without exiting Sublime.
Features
Execute your script from Sublime directly in Blender
Sublime Console shows the console output of Blender
I am still new to the world of Blender. I saw this as a good use for development.
But if there are more specific needs for Blender developers do let me know
This looks awesome and I just tried it out. Works great in Sublime Text 3, but doesnāt work in ST2. Maybe an excuse to finally upgrade up to ST3.
At one point I tried to create an auto-complete plugin for the BPY module (so it works like ctrl+space in the blender console). I didnāt have any luck with that at the time, have you done anything like that in Sublime Text? If this could also do hinting/auto-complete that would be amazing!
Think ST2 runs on Python2 and ST3 runs on Python 3 for writing pluginās ? (but can be wrong)
but the sublime plugin is quiet easy to setup so I will check out a ST2 version somewhere this week if you want.
ah the Auto-completion is a good idea to check out. Depends a bit how you have to populate a dropdown list in Sublime.
But you have any resources that already can point me in the good direction would be great!
PS : Hope you read the ābugsā section in the documentation. The āblender.exeā process will not shut down when you close blender. Since the SublimeBlender thread is not closed. So can be that it will block new connections.
As for the issue between st2 and st3, Iām sure it is the python versions. The error is in the url ārequestā module.
As far as autocomplete goes, the best I found was scraping the api web site here, but it didnāt seem like the best way to go about it: http://www.blender.org/documentation/blender_python_api_2_69_release/genindex.html
As for the current plugin, so Iām getting it to work for basic things. But I just created a quick panel for the toolbar and I can seem to get the script to run in blender. If I run it in blenders text editor it works (this just creates a simple button and panel in the toolbar), but if I run it via sublime it doesnāt.
Hereās what I have right now thatās causing the problem.
import bpy
class addLightViewPanel(bpy.types.Panel):
bl_label = "LightView"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
bl_context = 'objectmode'
def draw(self, context):
layout = self.layout
row = self.layout.row()
row.label(text="LightView")
row.operator("object.lightview", text="Run!", icon="PLAY")
# Create Operator
class OBJECT_OT_makelight(bpy.types.Operator):
bl_idname = "object.lightview"
bl_label = "LightView"
bl_description = "Create Light from current view"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
scn = bpy.context.screen.scene
scn.camera = coordcam
viewcoords = coordcam.location
print(coordcam)
obj = bpy.context.active_object
print(obj)
### Define Classes to register
classes = [addLightViewPanel, OBJECT_OT_makelight]
def register():
for c in classes:
bpy.utils.register_class(c)
# bpy.types.WindowManager.curve_tracer = bpy.props.PointerProperty(type=TracerProperties)
def unregister():
for c in classes:
bpy.utils.unregister_class(c)
# del bpy.types.WindowManager.curve_tracer
if __name__ == "__main__":
register()
Auto save file when executing the script from Sublime.
Current Issues:
I am still looking into the correct way of executing the script in Blender, cause it is still doing crazy things.
example : execute ābpy.ops.mesh.primitive_cube_add()ā : will create a cube but after that it jumps into edit mode. The problem is probably because the code runs in a different thread. I am still looking in to it. But if someone for different alternatives.
@crazycourier
You can see in my source code how to implement auto-completion in Sublime. I was able to plug the system in the default auto-completion system of Sublime. Really easy to do but it is not in the online documentation.
I still have to test your ui code that you gave but it is probably connected to the same problem given above.
I try to test it on Lubuntu 12.10ā¦ but dosenāt work
Addon in Blender, seems to work ok showing in the blender console:
Info: SublimeBlender Connection is open.
but sublime3 dosenāt do anything, not showing any errors on consoleā¦
my sublime package is under packages, and the name of the path is āBlender Developmentā, i can reach settings and keymap files, but shortcut donāt do anything (crtl + E, or alt + P), with command palette (crtl + shft + P) dosenāt work, tooā¦
Cool! But, can you make an autocomplete function for the Blender text editor?Im not good enough to make it, but your code suggests that you are on a pretty high level.It could be blessing for everyone, as, I suppose, I am not the only one who usees Blnederās text editor much more than external editors! It would be awesome!
I know this is hella necro posting, but I found this thread in my own searching and figured I would chime in since I had some trouble getting it to work. Following the setup instructions on github, if youāre on windows, itās likely not going to work right out of the box because the hotkey used to send the script to blender (alt+p) doesnāt workā¦ itāll just open the Project menu. You need to set or override a different hotkey in sublimeās keymap files. So, as an example- my Default.sublime-keymap (user) looks like:
Additionally, autocomplete and linting doesnāt work out of the box either- youāll need to download Python and add it to your PATH environment variable, and install the Anaconda package for sublime text (if you have package control enabled in sublime, just āinstall packageā and āanacondaā).
Hope that helps some other future person who ran into the same speedbumps I hit!
hi there, I just stumbled upon this after I bought sublime 3. any plans on updating this to blender 2.80 ?
I am trying myself, but since I am too new to python and blender, I canāt get it to work.
I am trying to follow this conversion tutorial https://www.youtube.com/watch?v=Mjy-zGG3Wk4.
I got it to show up in the addon manager but the command or the panel is not appearing in blender.