Giter Club home page Giter Club logo

blendpresence's Introduction

BlendPresence

This is an addon for Blender that allows you to show off what you're doing in Discord using Rich Presence.

BlendPresence currently supports versions 2.93 and higher.

Features

  • Up to two customizable buttons, redirecting to a link of your choice (portfolio, website, etc)
  • Current Blender version
  • Active render engine name
  • Name of current GPU in use
  • Current mode (object, edit, pose, etc)
  • Render stats while rendering (current frame and percentage complete)
  • Other context-sensitive features like:
    • Number of current frame
    • Name of current scene
    • Name of current object selected
    • Number of bones/polys/materials in the scene
    • And more

Installation

  1. Go to the Latest Release and download the blendpresence.zip file. DON'T UNZIP IT!
  2. Open Blender, then go to Edit > Preferences > Add-ons. Click Install... and select the zipfile.

Updating

  1. Select the BlendPresence dropdown in the add-ons menu and click Remove... - repeat the steps above for the newer version.

Troubleshooting

If the Rich Presence is not displaying, try the following:

  • In Discord, go to your User Settings > Activity Privacy > Display current activity as a status message and make sure it's enabled.
  • It could be a display bug. Refresh the Discord client by pressing Ctrl+R
  • It could be a bug with the addon. Try re-enabling it or go to Window > Toggle System Console and ensure no errors from BlendPresence appear.

Customizable Features

Core

  • Enabled determines if your rich presence will be shown on Discord.
  • Update Every determines how fast BlendPresence will update your presence in [x] seconds. Lower is faster.
    • Faster update rates may affect performance on lower-end machines. A recommended value is 5 seconds.

Large Icon Tooltip

  • Render Engine displays the render engine (Cycles, EEVEE, etc.) that's currently in use.
    • Some third-party render engines like Octane or Redshift will show their unique logo aside the blender logo while used.
  • Blender Version displays Blender version that the addon is running in.
  • Display GPU displays the name of the GPU Blender is using.
    • Currently, only NVIDIA cards are supported. Support for AMD, Intel and Apple cards may happen in the future.

Small Icon

  • (Viewport) Icon Set: Icon sets dynamically change based on what you're doing inside of Blender.
    • Active Mode: Displays the icon of the current mode in use (i.e. Object, Edit, Pose)
    • Active Workspace: Displays the relevant icon of your active workspace. For this to work, your current workspace name needs to be exactly one of the following: Modeling, Sculpting, UV Editing, Texture Paint, Shading, Animation, Rendering, Compositing, Geometry Nodes, Scripting
  • (Rendering) Render Stats displays render information such as frame resolution and FPS while rendering.

Buttons

  • A maximum of two buttons can be displayed at the bottom of your presence and can be personalized with any label and URL of their choosing.
    • IMPORTANT! The link MUST start with a protocol (https://)!

Details

  • Display Types: Literal is filler text that changes based on what you're doing, such as if you're rendering something, it will change to "Rendering a project". Alternatively you can set your own text by changing this setting to Custom
  • Display File Name overrides the setting above with the current .blend file name.
    • This will only work on saved files. If nothing shows up, you need to save your .blend file first.

State

  • (Viewport) Display Types: There are several object types that you can display in the presence, such as:
    • File Size: Displays the formatted file size of the current file.
    • Current Frame: Returns the frame number currently on the playhead.
    • Active Object: Returns the name of the active object.
    • Current Scecne: Returns the name of the current scene.
    • Active Object: Returns the name of the active object.
    • Object/Bone/Material/Polygon Count: Returns the number of specified objects in the current scene.
    • Custom: Allows the user to input their custom text.
  • (Rendering) Frame Range will display the current frame number that you're rendering. If it's an animation, it will fetch the frame range that's being rendered

Time Elapsed

  • Enabled will show the amount of time elapsed upon the addon being enabled. If you restart the addon, this timer resets.
  • Reset on Render will reset the timer when a render starts.

This plugin is a modified fork from Protinon/Blender-rpc

blendpresence's People

Contributors

abrasic avatar elitheproto avatar nyasami avatar robiot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blendpresence's Issues

Stuttering issues on latest blender

for some reason, ever since i upgraded to 4.1.1 on the steam side of blender. It now stutters every so often with this version.
My pc is pretty solid too, 5950x cpu 7900 xtx gpu, 64 gb ram.

Error on install

Tried installing it, but fails.
Blender version:

Blender 3.0.0
        build date: 2021-12-17
        build time: 06:39:03
        build commit date: 2021-12-02
        build commit time: 18:35
        build hash: f1cca3055776
        build platform: Linux
        build type: Release

Linux version:
5.16.2-1-MANJARO
Traceback:

Traceback (most recent call last):
  File "/usr/share/blender/3.0/scripts/modules/addon_utils.py", line 387, in enable
    mod.register()
  File "/home/dt/.config/blender/3.0/scripts/addons/blendpresence/__init__.py", line 582, in register
    bpi.connected = connectRPC()
  File "/home/dt/.config/blender/3.0/scripts/addons/blendpresence/__init__.py", line 16, in connectRPC
    rpcClient.connect()
  File "/home/dt/.config/blender/3.0/scripts/addons/blendpresence/pypresence/presence.py", line 43, in connect
    self.loop.run_until_complete(self.handshake())
  File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
    return future.result()
  File "/home/dt/.config/blender/3.0/scripts/addons/blendpresence/pypresence/baseclient.py", line 128, in handshake
    self.sock_reader, self.sock_writer = await asyncio.open_unix_connection(self.ipc_path, loop=self.loop)
  File "/usr/lib/python3.10/asyncio/streams.py", line 97, in open_unix_connection
    transport, _ = await loop.create_unix_connection(
TypeError: _UnixSelectorEventLoop.create_unix_connection() got an unexpected keyword argument 'loop'

The addon freezes Blender when it tries to load it.

I'm not sure how this is happening, but ever since today, the addon has caused my Blender installation to freeze. It causes Blender to hang when it tries to load it on startup, or if you try enabling it on the preferences window. Even trying to open my previous versions of 2.93 and 3.2 caused the same problem. The only way to stop the freezing was for me to remove it from the scripts folder so Blender can't find it and load it while it's using my main config.

I have no idea why that is happening, or why it spontaneously begun just today. But it did make me think that somehow my userpref.blend file was retroactively corrupted.

Here is the script of the addon from the appdata scripts folder for 3.3, along with my preferences file too. In case that can help you troubleshoot this bizarre bug.

Prefs and addon.zip

Update For 4.2?

Just wondering if this project is even still active at all?

[request] Exclude list for projects

it would be neat to have an exclude list where we can tell blend presence to suppress details about the project if it notices the project open matches to something on the list. preferably controllable options on what it hides, but if it makes it too complicated and has to be one way - I'd suggest it still keeps the elapsed time.

Addon producing error when enabled.

Every time I try to enable the addon I get this error:

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.93\2.93\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\inkoalawetrust\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\blendpresence\__init__.py", line 30, in <module>
    class bpi:
  File "C:\Users\inkoalawetrust\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\blendpresence\__init__.py", line 36, in bpi
    blendGPU = gpu.platform.renderer_get()
AttributeError: module 'gpu' has no attribute 'platform'

This is pretty much all I get when I try turning the addon on. So I don't have any other information to add. Besides that it doesn't seem to like something about my GPU.

"This version of Blender does not support 'Display GPU'" error

So Blender Presence was working for a while and for some reason when I opened up Blender, it doesn't take me to the splash screen and instead the console for Blender is stuck where this line is: image
I updated my Blender and the same thing happens on the 3.6 version also and taking the addon off makes Blender start up as normal. I was wondering how I can fix this problem.

State display cycling.

Do you think it would be possible to cycle through all the states on a timer? Say every 15 seconds (think that's the pypresence update limit, from what I remember) it would go between all the available options in the dropdown menu.
image

Error Activating in Blender 4.0.2

After installing the addon in Blender 4.0.2 and try activacting the addon I get this issue:
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\addon_utils.py", line 364, in enable
mod = importlib.import_module(module_name)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\QUESO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blendpresence_init
.py", line 27, in
rpcClient = Presence("766373631424200705")
File "C:\Users\QUESO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blendpresence\pypresence\presence.py", line 13, in init
super().init(*args, **kwargs)
File "C:\Users\QUESO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blendpresence\pypresence\baseclient.py", line 40, in init
self.update_event_loop(self.get_event_loop())
File "C:\Users\QUESO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blendpresence\pypresence\baseclient.py", line 83, in get_event_loop
loop = asyncio.get_event_loop()
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\asyncio\events.py", line 656, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'MainThread'.

[request] Large Icon

(dont know if this is possible but... if possible) it would be cool to use the preview image that blender uses in the file browser as rich presence large icon
image

New Option for display filename

Instead of it being literal or custom, can a third option include filename only, like without the ,blender after it? Thats all i want like to see added :)

exceptions.InvalidID: Client ID is Invalid

BlendPresence will stop displaying the RPC when this error occurs:
blendpresence.pypresence.pypresence.exceptions.InvalidID: Client ID is Invalid
The cause of this seems to be a simple timeout, however the next version will detect this error and will continue to reconnect until a connection is made.

The temporary fix is to re-enable the addon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.