blackstartx / pycharm-blender-plugin Goto Github PK
View Code? Open in Web Editor NEWA PyCharm Plugin that simplify the development of Blender Add-On inside the PyCharm IDE.
License: MIT License
A PyCharm Plugin that simplify the development of Blender Add-On inside the PyCharm IDE.
License: MIT License
Exception in thread Thread-1 (start_client):
Traceback (most recent call last):
File "D:\Blender version\daily\blender-4.0.2-stable+v40.9be62e85b727-windows.amd64-release\4.0\python\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "D:\Blender version\daily\blender-4.0.2-stable+v40.9be62e85b727-windows.amd64-release\4.0\python\lib\threading.py", line 953, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\jungh\AppData\Local\Temp\BlendCharm\pycharm_connector.py", line 156, in start_client
on_data(s, s.recv(struct.unpack('>i', s.recv(4))[0]))
File "C:\Users\jungh\AppData\Local\Temp\BlendCharm\pycharm_connector.py", line 101, in on_data
json_data = json.loads(data)
File "D:\Blender version\daily\blender-4.0.2-stable+v40.9be62e85b727-windows.amd64-release\4.0\python\lib\json_init.py", line 341, in loads
s = s.decode(detect_encoding(s), 'surrogatepass')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 68: invalid start byte
Hello. I'm just using and testing your plugin. I tried to run blender using pycharm. but, it doesn't work and show the addon that i developed.
Hello BlackStartx,
tried to get your plugin working in osx, unfortunately it didn't work.
Found in the …/scr/main/java/data/BlenderExeFileChooserDescriptor.java that it only takes *.exe as instance.
Would it be possible to comment out the dependency to see if it also runs on the mac version of blender?
Unfortunately I don't know java to be able to do something with the source code myself…
Thanks, it would be great to hear from you.
daidalos42
Hi, Love this tool!
I wanted to report that since upgrading to 2023.1 I can't press the debug icon next to my chosen blender instance. I get the stack trace listed at the bottom.
I'm running the following versions:
PyCharm 2023.1 - Build #PY-231.8109.197, built on March 30, 2023
Blend-Charm 2023.1
java.lang.NullPointerException: Cannot invoke "String.toLowerCase()" because "ui.tool_window.BlenderToolWindow.getSelectedBlenderInstance().addonPath" is null
at ui.tool_window.BlenderToolWindow$3.<init>(BlenderToolWindow.java:398)
at ui.tool_window.BlenderToolWindow.onDebugClick(BlenderToolWindow.java:397)
at util.MySwingUtil$1.mouseClicked(MySwingUtil.java:15)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6659)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
at java.desktop/java.awt.Component.processEvent(Component.java:6421)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4584)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2804)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:790)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:763)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:761)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:760)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:614)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:569)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
when print i got nothing
and when closed blender, i got that
Hello! I am trying to use the plugin for some Blender development. Is there a setting somewhere or something I need to do to get the mark folder as ...
menu options?
PyCharm Version: 2023.3.2
BlendCharm Version: 2023.3
I used the plugin to create a new Blender Addon. The folder contains an __init__.py
module.
import bpy
bl_info = {
"name": "Exporter",
"author": "shall",
"description": "Exporter",
"blender": (4, 0, 2),
"location": "View3D",
"warning": "",
"category": "Generic"
}
classes = (
)
register, unregister = bpy.utils.register_classes_factory(classes)
Cheers!
Seth
When I try the addon with the debug mode, It starts it but nothing happens, Blender starts, but nothing happens.
The addon doesn't show or anything
There's no logs, when I do modifications it doesn't reload the plugin, etc...
HOWEVER, if I use the VSCode Blender Development integration, it works perfectly:
Hi,
Your plugin looks very usefull. Unfortunately I get the following error when i try to install it in pycharm 2021.1.1:
"Plugin 'Blend-Charm' (version '1.0') is not compatible with the current version of the IDE, because it requires build 203.* or older but the current build is PY-211.7142.13"
I increased the intellij version that was targeted, and fixed some deprecation warnings. This allows the plugin to be installed under Pycharm 2021.1.1 as well. I will link my PR to this issue.
Hi!
I've managed to install it, and followed the configuration steps to the letter (to the best of my knowledge ;-) )
I've then created a new Blender Addon just as in the instructions you've provided.
The problem is that the template file __init__.py
does start with import bpy
, but PyCharm does not recognize that module.
I am able to reproduce my problems on Ubuntu 20.04 with Blender installed from Snap and PyCharm Professional 2022.1,
and on MacOS (12.3.1) with Blender installed using the manual method from the blender.org with PyCharm CE 2022.1.
Pycharm error message:
Plugin 'Blend-Charm' (version '2023.3') is not compatible with the current version of the IDE, because it requires build 233.* or older but the current build is PY-241.14494.241
Hi!
I believe I have managed to install and configure the PyCharm-Blender-Plugin.
I've then created a new Blender Addon just as in the instructions you've provided.
I've used a toy blender plugin code "Move X Axis" available from https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html. The code installs a trivial Object addon, and I have verified it works on my Blender if I install it manually.
"Running" the Blender works: When I hit the "Run" button from within the "Blender-Plugin" panel (not the one I usually push to debug local Python code), I get the Blender opened with my addon installed.
When I hit the "Debug" I also get the Blender app opened with my addon installed (yes, the new version gets installed over whatever other version of my Addon I might have had). The problem is that the PyCharm status reports waiting for the "Process Connection..." forever.
In the meantime, when I set a breakpoint inside the code of my addon and execute it from within the Blender, I don't get the debug experience.
I have exactly the same problem on Ubuntu 20.04 with Blender 3.1.2 and PyCharm 2022.1 Professional installed from snap and on
MacOs 12.3.1 with PyCharm 2022.1 Professional and Blender 3.1.2
Good day @BlackStartx
First of all, I just found your plugin and want to say a big heartfelt thank you for it! 💯
Blender can use a number of environment variables and in my current setup, I must use the following two:
BLENDER_USER_CONFIG
BLENDER_USER_SCRIPTS
I'm wondering if there is a way within your plugin for me to set these up before the instances are started?
For normal Blender launching, I have a batch file that SETs them before executing Blender and while, for a regular Python program, I would normally do it through PyCharm's run configurations, I tried starting Blender with the --python C:\Users\User\AppData\Local\Temp\BlendCharm\pycharm_connector.py --
argument as an external tool in the run config but it didn't work ¯\(ツ)/¯
Another potential way... Could it be even possible to use the standard run configuration settings to set the ENV variable and then to trigger your plugin?
Thanks again :)
Looks like a great addon I'm keen to use. However an issue which is it only works on Windows with a app installed via a .msi/.ese installation. A Steam installation can't be used, nor a Windows store Blender install.
When right clicking and navigating to New -> Blend-Charm only see 'Create New Blender Addon', there is no option to mark a folder as a Blender add on.
Also, after creating a Blender add on folder, the code generated cannot find the bpy module
Am I missing something?
Environment...
PyCharm 2023.1.1 (Professional Edition)
Build #PY-231.8770.66, built on April 27, 2023
Runtime version: 17.0.6+10-b829.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2038M
Cores: 12
Non-Bundled Plugins:
mobi.hsz.idea.gitignore (4.5.0)
org.blackstartx.blend-charm (2023.1)
Thanks for your addon.
Is it possible to output to the console via print?
Files are updated when the text changes, but there is no printing to the console.
I need functionality similar to how it is done in the addon for VSCode
Windows 11
Blend-Charm.2022.3.Community.Edition
Blender 3.4
After the update to blender 4.0 when I attempt to run blender from the plugin I get the following error:
blender: ../external_epoxy/src/dispatch_common.c:872: epoxy_get_proc_address: Assertion
0 && "Couldn't find current GLX or EGL context.\n"' failed.`
I am running the plugin on Ubuntu 20. I have a tweaked build of the plugin to get it to work properly, but the changes are fairly minor and it worked fine with blender 3.6.
Can anyone confirm if the plugin continues to work (or not) on officially supported operating systems?
I get a random NullPointerException when using the plugin
java.lang.NullPointerException
at data.VirtualBlenderFile.getRelativeAddonName(VirtualBlenderFile.java:51)
at ui.tool_window.BlenderToolWindow.onSave(BlenderToolWindow.java:122)
at ui.tool_window.BlenderToolWindow.access$000(BlenderToolWindow.java:52)
at ui.tool_window.BlenderToolWindow$1.after(BlenderToolWindow.java:114)
at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:642)
at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:617)
at com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:417)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:391)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:373)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:34)
at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:180)
at com.sun.proxy.$Proxy132.after(Unknown Source)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.fireAfterEvents(PersistentFSImpl.java:1219)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl$3.close(PersistentFSImpl.java:806)
at com.intellij.openapi.fileEditor.impl.LoadTextUtil.write(LoadTextUtil.java:450)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocumentInWriteAction$4(FileDocumentManagerImpl.java:417)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:326)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocumentInWriteAction(FileDocumentManagerImpl.java:406)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocument$2(FileDocumentManagerImpl.java:367)
at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:86)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1003)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1029)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:85)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocument(FileDocumentManagerImpl.java:367)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocuments(FileDocumentManagerImpl.java:287)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:262)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:255)
at com.intellij.execution.console.ConsoleExecutionEditor$1.lambda$focusGained$0(ConsoleExecutionEditor.java:65)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:215)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:197)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:511)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:69)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:112)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
All of a sudden, clicking on Run doesn't do anything anymore. I deleted and added back the Blender istance, I unmarked then marked back the folder as a Blender addon.
Nothing works. I click on the Run button and Blender does not start. No crash, no errors.
I see the shortcut in the scripts folder, the addon runs fine inside Blender when open directly (though I don't see it in the addon list), but from PyCharm I cannot run it anymore
Read prefs: C:\Users\Administrator\AppData\Roaming\Blender Foundation\Blender\3.0\config\userpref.blend
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\Program Files\Blener\blender-3.0.0-alpha\3.0\python\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "D:\Program Files\Blener\blender-3.0.0-alpha\3.0\python\lib\threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Administrator\AppData\Local\Temp\BlendCharm\pycharm_connector.py", line 147, in start_client
on_data(s, s.recv(struct.unpack('>i', s.recv(4))[0]))
File "C:\Users\Administrator\AppData\Local\Temp\BlendCharm\pycharm_connector.py", line 104, in on_data
script_folder = bpy.utils.user_resource('SCRIPTS', "addons")
TypeError: user_resource() takes 1 positional argument but 2 were given
blender 3.0 alpha
when i click run/debug in pycharm i got the error.
it look like error in blender threading.py
First of all, thanks a ton for making this plugin for PyCharm, I don't really enjoy my time with VS Code and I find that PyCharm is a much better IDE overall (for Python at least). The reason I didn't purchase PyCharm Professional was because of the lack of an addon like this in the first place, so I might end up purchasing it if the plugin ends up working :)
Currently on PyCharm Community 2021.2.1 I can manage to open a Blender 2.93 instance and load up my plugin, but it doesn't seem to be updating when I save, but if I press the Play button and open another Blender Instance the plugin is updated in this new Blender instance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.