Skip to content

Instantly share code, notes, and snippets.

View yohawing's full-sized avatar

yohawing yohawing

View GitHub Profile
@yohawing
yohawing / webrtc1_callback.py
Created June 26, 2025 02:43
TouchDesignerでWebRTCを扱うサンプルコード(AyameLabo シグナリングサーバーを使用)
"""
TouchDesigner WebRTC Callback Script
This script handles WebRTC connection management and data channel communication in TouchDesigner.
Note: This script uses TouchDesigner built-in functions and variables:
- op(): Access to TouchDesigner operators
- me: Reference to the current component
- parent(): Access to parent component parameters
- logger: TouchDesigner's logging component
"""
@yohawing
yohawing / bake_deformer.py
Created April 14, 2024 03:46
【Maya】Bake Deformer to Blendshape Tareget with time range
import maya.cmds as cmds
import ywta.deform.blendshape as blendshape
import maya.mel as mel
# 現在のメッシュのをBlendShapeターゲットに追加
def add_blendshape_target_with_frame(mesh, frame):
# blendspageがなければ作成
blendshape_name = blendshape.get_blendshape_node(mesh)
@yohawing
yohawing / export_fbx_to_Unity.py
Created March 11, 2024 00:47
[maya] Simple_FBX_Exporter
import maya.cmds as cmds
import maya.mel as mel
from functools import partial
import os
# ネームスペースを消そうとするが、ReferenceされたNamespaceは削除できないようになってる。
# defaults = ['UI', 'shared']
# namespaces = [ns for ns in cmds.namespaceInfo(listOnlyNamespaces=True, recurse=True) if ns not in defaults]
# for ns in namespaces: print(ns)
# namespaces.sort(key=len, reverse=True)
@yohawing
yohawing / setup_comfy_on_modal.py
Created October 17, 2023 11:53
Modal上にComfyUIをセットアップするスクリプト
from pathlib import Path
import time
import modal
import shutil
import subprocess
import sys
import shlex
import os
# 色んなパスの定義
@yohawing
yohawing / createStretchySplineIK.py
Last active September 30, 2023 03:00
[maya] Make Stretchy Spline IK
import maya.cmds as cmds
# StartJointからEndJointに関連付けられているJointをListで取得
# Childが一つの想定なので骨が複数あるとおかしくなるかも。
def get_all_spline_joints(joint_list, parent_joint, last_joint):
child = cmds.listRelatives(parent_joint, children=True, type="joint")
joint_list.append(child[0])
if child and last_joint not in child:
get_all_spline_joints(joint_list, child[0], last_joint)
else:
@yohawing
yohawing / create_joint_by_vert.py
Last active September 5, 2023 12:51
[maya]選択した頂点にボーンを生成
import maya.cmds as cmds
selected_verts = cmds.ls(selection=True, flatten=True)
if len([vert for vert in selected_verts if 'vtx' in vert]) is 0:
cmds.warning("頂点が選択されていません。")
else:
total_pos = [0.0, 0.0, 0.0]
for vert in selected_verts:
vert_pos = cmds.pointPosition(vert, w=True)
@yohawing
yohawing / copy_parent_joint_orient.py
Created September 4, 2023 13:25
親ボーンのJointOrientをコピーして適応するスクリプト
import maya.cmds as cmds
selected_joint = cmds.ls(selection=True, flatten=True)
for jnt in selected_joint:
tr = cmds.ls(jnt, type="transform")
parent_tr = cmds.listRelatives(tr, parent=True, fullPath=False)
if parent_tr:
rot = cmds.getAttr(parent_tr[0] + ".jointOrient")
@yohawing
yohawing / SimpleUDPClient.hpp
Created April 20, 2023 21:39
Winsock2 Simple UDP Client CPP
#pragma once
#include <stdio.h>
#include <string>
#include <WinSock2.h>
#include <WS2tcpip.h>
using namespace std;
class UDPClient
{
@yohawing
yohawing / AutoObjectAnimationConverter.py
Last active July 20, 2023 13:23
ObjectのTransformアニメーションをAmatureのAnimationに変換するBlenderスクリプト
import os
import bpy
from bpy_extras.object_utils import AddObjectHelper, object_data_add
#https://dskjal.com/blender/bone-script.html
def init():
active = bpy.context.active_object
@yohawing
yohawing / maya_fbx_export.bat
Created September 24, 2020 07:25
Mayaファイルをバッチ処理でFBXExportするさせる
SET MAYABATCH="C:\Program Files\Autodesk\Maya2020\bin\mayabatch.exe"
SET mayafile=%1
SET outfile=%2
SET VER=FBXExportFileVersion -v FBX201800;
SET TRI=FBXExportTriangulate -v true;
SET PROPS=%VER%%TRI%
%MAYABATCH% -file %mayafile% -command "%PROPS%FBXExport -f ""%outfile%"";"