Skip to content

Instantly share code, notes, and snippets.

View nobolu-ootsuka-unrealengine's full-sized avatar

nobolu.ootsuka.unrealengine@gmail.com nobolu-ootsuka-unrealengine

View GitHub Profile
# -*- coding: utf-8 -*-
import os
from functools import partial
import time
import imp
import random
"""
PySide2モジュールを探し、ある場合はそちらをインポートします。
@nobolu-ootsuka-unrealengine
nobolu-ootsuka-unrealengine / MayaDockingClass.py
Created April 12, 2022 04:17 — forked from mottosso/MayaDockingClass.py
Maya 2017 PySide2 Docking Qt QMainWindow
"""
This is what you need to do in order to get a qt window to dock next to maya channel box,
In all maya versions, including 2017 with PySide2
"""
__author__ = "liorbenhorin@gmail.com"
import sys
import os
import logging
import xml.etree.ElementTree as xml
@nobolu-ootsuka-unrealengine
nobolu-ootsuka-unrealengine / get_collide_from_ray.py
Created February 25, 2022 07:53 — forked from hexagit/get_collide_from_ray.py
Mayaで指定ベクトルの衝突判定を行う
# -*- coding: utf-8 -*-
#===========================================
# カメラから直線方向にある選択メッシュに対してRayを飛ばす
# (視野角は考慮してないんでカメラは方向だけです。)
#===========================================
import maya.api.OpenMaya as om
# vector用カメラの諸々を取得
camera_selList = om.MGlobal.getSelectionListByName("camera1")
from maya import cmds ,OpenMaya
# ジョイントのローカルXの差が出したいから
start = cmds.xform("joint1" , q=1 , ws = 0 , translation =1)
end = cmds.xform("joint2" , q=1 , ws = 0 , translation =1)
print("start[0]="+str(start[0]))
print("end[0]="+str(end[0]))
long=end[0]-start[0]
long=abs(long)
long=long*1
@nobolu-ootsuka-unrealengine
nobolu-ootsuka-unrealengine / matchRotationJointAndRig.py
Last active September 15, 2019 02:09
matchRotationJointAndRig.py
import maya.cmds as cmds
# ジョイントに回転をマッチさせたいから ジョイントにカーブを拘束と書く
node=cmds.orientConstraint( 'joint1', 'Cube' ,maintainOffset=False)
# ジョイントに回転をマッチさせたら消す。
cmds.delete(node)
# リグとしてはカーブで動かしたいから カーブにジョイントを拘束と書く
@nobolu-ootsuka-unrealengine
nobolu-ootsuka-unrealengine / UE4_Python_Asset_SkeletalMesh_Importer.py
Created June 15, 2019 04:48
UE4_Python_Asset_SkeletalMesh_Importer.py
import unreal
# FBXインポート時の設定
mesh_data = unreal.EditorAssetLibrary.find_asset_data(task.destination_path + task.destination_name)
mesh = mesh_data.get_asset()
mesh.skeleton
op = unreal.FbxImportUI()
op.import_materials = True # マテリアルもインポート
#pragma once
#include "UnrealEd.h"
#include "SlateStyle.h"
#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush(RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__)
class FMyPluginStyle : public FSlateStyleSet
{
public:
FMyPluginStyle()
: FSlateStyleSet("MyPluginStyle")
{
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "../Public/MyPlugin.h"
#include "MyPluginStyle.h"
#include "LevelEditor.h"
#include "MultiBox/MultiBoxBuilder.h"
#include "Textures/SlateIcon.h"
#include "Editor/MainFrame/Public/Interfaces/IMainFrameModule.h"
#include "SWindow.h"
#include "SlateApplication.h"
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
namespace UnrealBuildTool.Rules
{
public class MyPlugin : ModuleRules
{
public MyPlugin(ReadOnlyTargetRules Target) : base(Target)
{
PublicIncludePaths.AddRange(
new string[] {
@nobolu-ootsuka-unrealengine
nobolu-ootsuka-unrealengine / FragmentWithSurface.shader
Created March 25, 2019 20:57 — forked from shop-0761/FragmentWithSurface.shader
Fragment と surface を一緒に使うやつ
Shader "Custom/fragmentWithSurface" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
}
SubShader {
Tags { "RenderType"="Opaque" }