Blender addon for executing the operator in response to the received OSC message.

Related tags

MiscellaneousIFJoiner
Overview

I/F Joiner

受信したOSCメッセージに応じてオペレータ(bpy.ops)を実行するアドオンです. OSC通信に対応したコントローラやアプリをインストールしたスマートフォンを使用してBlenderを操作することが可能になります.

同時開発しているAndroidコントローラ化アプリMocopaは当アドオンと併せた使用がおすすめです.

Feature

  • OSCメッセージの受信
  • 受信したOSCメッセージに応じて実行するオペレータの割り当て設定
    • OSCメッセージの引数をオペレータの引数に代入可能
  • 割り当て設定のエクスポートやインポート(JSON形式)
  • Blender 2.8以降に対応
    • Windowsでの使用を推奨します.Macでも動作しますが頻繁にクラッシュするようです.

Install

  1. Releases Pageからzipファイルをダウンロード

  2. Blenderを起動しトップバーから「Edit」→「Preference」を開く

  3. Preferenceウィンドウ左側メニューから「Addon」→ウィンドウ右上「Install」ボタンをクリックしダウンロードしたzipファイルをインストール

  4. 「Community」が選択された状態でInterface: I/F Joinerがアドオンリストに追加されていること確認したら,チェックを入れて有効化する.

How to Use

OSCサーバの起動と停止

アドオンをインストールすると,3DViewのプロパティシェルフに「I/F Joiner」タブが追加されます.

IP AddressにBlenderを起動しているPCのIPアドレス,Port Numberに任意のポート番号を入力し「Start」をクリックしてOSCサーバを起動します.Windowsでは初回起動時にファイアウォールのポップアップが表示されることがあります.その場合は「アクセスを許可する」をクリックしてください.

サーバが起動するとOSCメッセージの受信を開始します.

停止させる際は「Stop」をクリックします

受信したOSCメッセージの確認方法

Windowsの場合

トップバー「Window」→「Toggle System Console」でコマンドプロンプトを開きます. OSCサーバが起動した状態でOSCメッセージを受信するとアドレスパターンと引数がそれぞれ表示されます.

Macの場合

ターミナルからBlenderを起動します.

Blenderがアプリケーションフォルダにインストールされている場合はターミナルに以下を入力してBlenderを起動します.

/Applications/Blender.app/Contents/MacOS/Blender

OSCサーバが起動した状態でOSCメッセージを受信するとアドレスパターンと引数がターミナルにそれぞれ表示されます.

受信したOSCメッセージに対するオペレータの割り当て

  1. I/FJoinerのPreferenceを表示し,Message Mapsの 「Add Message Map」 をクリックして割り当て設定を一つ追加します.

  2. 追加されたボックスの入力欄に機能を割り当てたいメッセージのアドレスパターンを入力します.

  3. 左端の三角形をクリックするとメニューが展開します.「Add」をクリックして実行するオペレータを一つ追加します.

  4. Keymapの設定と同様に,実行するオペレータのIdentifierを入力し指定します. 公式ドキュメントでは各オペレータはbpy.ops.hogehoge()の形で記載されていますが,先頭のbpy.opsと末尾の()を切り取ったhogehogeがIdentifierになります.

    bpy.ops.view3d.toggle_shading(type='WIREFRAME')view3d.toggle_shading

  5. 実行するオペレータの引数を入力します.OSCメッセージに含まれる引数を渡すことが可能です. OSCメッセージに含まれる引数の先頭から順にarg[0], arg[1], arg[2]...でアクセスできます.

    type='HOGEHOGE', value=arg[0]

  6. オペレータを実行する条件を設定します.OSCメッセージに含まれる引数のうち先頭から最大3つまで,何れもFloatの値であり3つの引数全てが最大値・最小値の範囲内にあるとき(min ≦ arg ≦ max)オペレータが実行されます.Event TriggerのMin・Maxに上から引数の順に範囲を入力してください.

Blenderで提供されるオペレータは以下の公式ドキュメントを参照してください.

https://docs.blender.org/api/current/bpy.ops.html

一つのアドレスパターンに対し複数のオペレータを設定することが可能です.実行条件が同一な複数のオペレータを設定した場合は,条件に合致したオペレータがリストの上から順に実行されます.

割り当ての保存と読み込み

Message Mapの割り当てを編集したら,必ず「Save」をクリックしてPreference Fileを保存してください.

また左下ハンバーガーメニューの「Save Preference」でPreference Fileのファイルパスを保存すると,次回起動時は保存したファイルから自動的に設定が読み込まれます.初回起動時は必ず「Save Preference」をクリックしてください.

「Load」からも保存したPreference Fileを読み込めます.バックアップや割り当ての共有に利用できます.

また各Message MapはJSON形式でエクスポート・インポートが可能です.Templateフォルダに割り当てサンプルがあるので「Import Message Map from .json」から読み込んでみてください.

Tips

オペレータの引数に四則計算した値を代入する

オペレータの引数を設定する入力フォーム内で値の四則計算が可能です. OSCメッセージに含まれる引数に対して使うと便利です.

value = arg[0] * 485 + 583

パラメータを変更する

例えばスカルプトブラシの大きさなど,パラメータを変更したい場合はWm Operatorsのbpy.ops.wm.context_set_int()bpy.ops.wm.context.set_float()を使用します.

詳しくは以下の公式ドキュメントを参考にしてください. https://docs.blender.org/api/current/bpy.ops.wm.html

設定例です.

キー入力をシミュレートする

I/F Joinerはキー入力をシミュレートするオペレータを提供します.以下の3つです.

  • ifj.send_key_press(key='keyname')

    • 引数で設定したキーを押します.
  • ifj.send_key_release(key='keyname')

    • 引数で設定したキーを離します.
  • ifj.send_key_press_and_release(key='keyname')

    • 引数で設定したキーを押して離します.

Aキーをシミュレートする設定例です.

オペレータを自作して登録する

Blenderのアドオン保存フォルダ/ifjoiner/custom_operatorsにクラス名がIFJ_から始まるオペレータを書いた.pyファイルを置いておくと自動的に登録されます.

Credits

使用させていただいたライブラリ

参考にさせていただいたアドオン

  • AddRoutes

    OSC通信に加えてMIDI通信も可能なBlenderの各パラメータを操作することができるアドオンです.

参考にさせていただいたサイト

You might also like...
A Blender addon for VSE that auto-adjusts video strip's length, if speed effect is applied.

Blender VSE Speed Adjust Addon When using Video Sequence Editor in Blender, the speed effect strip doesn't auto-adjusts clip length when changing its

Blender addon, import and update mixamo animation

This is a blender addon for import and update mixamo animations.

Blender 2.80+ Timelapse Capture Tool Addon

SimpleTimelapser Blender 2.80+ Timelapse Capture Tool Addon Developed for Blender 3.0.0, tested working on 2.80.0 It's no ZBrush undo history but it's

A Blender addon to enable reloading linked libraries from UI.

library_reload_linked_libraries A Blender addon to enable reloading linked libraries from UI.

Blender addons - A collection of Blender tools I've written for myself over the years.
Blender addons - A collection of Blender tools I've written for myself over the years.

gret A collection of Blender tools I've written for myself over the years. I use these daily so they should be bug-free, mostly. Feel free to take and

Blender-3D-SH-Dma-plugin - Import and export Sonic Heroes Delta Morph animations (.anm) into Blender 3D

io_scene_sonic_heroes_dma This plugin for Blender 3D allows you to import and ex

Blender-miHoYo-Shaders - Shaders for Blender attempting to replicate the shading of games developed by miHoYo
Blender-miHoYo-Shaders - Shaders for Blender attempting to replicate the shading of games developed by miHoYo

Blender-miHoYo-Shaders - Shaders for Blender attempting to replicate the shading of games developed by miHoYo

Using Python to parse through email logs received through several backup systems.

outlook-automated-backup-control Backup monitoring on a mailbox: In this mailbox there will be backup logs. The identification will based on the follo

nbsafety adds a layer of protection to computational notebooks by solving the stale dependency problem when executing cells out-of-order
nbsafety adds a layer of protection to computational notebooks by solving the stale dependency problem when executing cells out-of-order

nbsafety adds a layer of protection to computational notebooks by solving the stale dependency problem when executing cells out-of-order

Releases(v0.01)
Owner
simasimataiyo
simasimataiyo
Attempt at a Windows version of the plotman Chia Plot Manager system

windows plotman: an attempt to get plotman to work on windows THIS IS A BETA. Not ready for production use just yet. Almost, but not quite there yet.

59 May 11, 2022
a really simple bot that send you memes from reddit to whatsapp

a really simple bot that send you memes from reddit to whatsapp want to use use it? install the dependencies with pip3 install -r requirements.txt the

pai 10 Nov 28, 2021
Binjago - Set of tools aiding in analysis of stripped Golang binaries with Binary Ninja

Binjago 🥷 Set of tools aiding in analysis of stripped Golang binaries with Bina

W3ndige 2 Jul 23, 2022
Python tools for experimenting with differentiable intonation cost measures

Differentiable Intonation Tools The Differentiable Intonation Tools (dit) are a collection of Python functions to analyze the intonation in multitrack

Simon Schwär 2 Mar 27, 2022
A simple, fantasy and fast note taking program.

notes A simple, fantasy and fast note taking program Installation This program supposed to run in linux and may have some bugs on windows or any other

Ali Hosseinverdi 1 Apr 06, 2022
GCP Scripts and API Client Toolss

GCP Scripts and API Client Toolss Script Authentication The scripts and CLI assume GCP Application Default Credentials are set. Credentials can be set

3 Feb 21, 2022
TurtleBot Control App - TurtleBot Control App With Python

TURTLEBOT CONTROL APP INDEX: 1. Introduction 2. Environments 2.1. Simulated Envi

Rafanton 4 Aug 03, 2022
An application to see if your Ethereum staking validator(s) are members of the current or next post-Altair sync committees.

eth_sync_committee.py Since the Altair upgrade, 512 validators are randomly chosen every 256 epochs (~27 hours) to form a sync committee. Validators i

4 Oct 27, 2022
A Python package that provides astronomical constants.

AstroConst A Python package that provides astronomical constants. The code is being developed by Marc van der Sluys of the department of Astrophysics

Marc van der Sluys 1 Jan 10, 2022
All kinds of programs are accepted here, raise a genuine PR, and claim a PR, Make 4 successful PR's and get the Stickers and T-Shirt from hacktoberfest 2021

this repository is excluded from hacktoberfest Hacktoberfest-2021 This repository aims to help code beginners with their first successful pull request

34 Sep 11, 2022
A python script for osu!lazer rulesets auto update.

osu-lazer-rulesets-autoupdater A python script for osu!lazer rulesets auto update. How to use: 如何使用: You can refer to the python script. The begining

3 Jul 26, 2022
Simple control of Thorlabs Elliptec devices from Python.

Elliptec Simple control of Thorlabs Elliptec devices. No docs yet » Get started · Report a bug · Request a feature About The Project ThorLabs Elliptec

David Roesel 8 Sep 22, 2022
An alternative app for core Armoury Crate functions.

NoROG DISCLAIMER: Use at your own risk. This is alpha-quality software. It has not been extensively tested, though I personally run it daily on my lap

12 Nov 29, 2022
Simple Python tool to check if there is an Office 365 instance linked to a domain.

o365chk.py Simple Python script to check if there is an Office365 instance linked to a particular domain.

Steven Harris 37 Jan 02, 2023
Ingest openldap data into bloodhound

Bloodhound for Linux Ingest a dumped OpenLDAP ldif into neo4j to be visualized in Bloodhound. Usage: ./ldif_to_neo4j.py ./sample.ldif | cypher-shell -

Guillaume Quéré 71 Nov 09, 2022
Cardano SundaeSwap ISO SPO vote ranking script

Cardano SundaeSwap ISO SPOs vote ranking This Python 3 script uses the database populated by cardano-db-sync from the Cardano blockchain to generate a

SM₳UG 1 Nov 17, 2021
Feapder的管道扩展

FEAPDER 管道扩展 简介 此模块为feapder的pipelines扩展,感谢广大开发者对feapder的贡献 随着feapder支持的pipelines越来越多,为减少feapder的体积,特将pipelines提出,使用者可按需安装 管道 PostgreSQL 贡献者:沈瑞祥 联系方式:r

boris 9 Dec 07, 2022
Team collaborative evaluation tracker.

Team collaborative evaluation tracker.

2 Dec 19, 2021
Astroquery is an astropy affiliated package that contains a collection of tools to access online Astronomical data.

Astroquery is an astropy affiliated package that contains a collection of tools to access online Astronomical data.

The Astropy Project 631 Jan 05, 2023
Visualize Data From Stray Scanner https://keke.dev/blog/2021/03/10/Stray-Scanner.html

StrayVisualizer A set of scripts to work with data collected using Stray Scanner. Usage Installing Dependencies Install dependencies with pip -r requi

Kenneth Blomqvist 45 Dec 30, 2022