Skip to content

Instantly share code, notes, and snippets.

View PIL_Resize.py
import os
from PIL import Image
import getpass
import glob
import_file = os.path.join('C:/Users',getpass.getuser(),'入力ファイル名')
export_file = os.path.join('C:/Users',getpass.getuser(),'入力ファイル名')
#リサイズ後の横幅
RESIZE_X = 1280
View PySimpleGUI-MakeGUI.py
import PySimpleGUI as sg
layout = [ [ sg.Text("ファイル選択"),sg.InputText(),sg.FileBrowse() ] ,
[sg.Text("文字入力") ,sg.InputText("ここに文字入力",key ="-TEXT-")],
[sg.Checkbox("チェックボックス",key="CHECK-BOX-")],
[sg.Button("ボタン", key="-SAMPLE-BUTTON-")] ,
[sg.Listbox(["Sample A","Sample B","Sample C"],size=(50,5))],
[sg.Combo(["Sample D","Sample E","Sample F"])],
[sg.ProgressBar(1000,orientation="h",size=(20,20),key="progbar")],
]
View MakeFolderSample.py
import os
filepath = 'Sample/sample'
#フォルダ作成(存在すれば作成しない)
if not os.path.isdir(filepath):
os.mkdir(filepath)
View SampleBlenderAddon_2.py
import bpy
import bmesh
bl_info = {
"name": "TomoG_Sample",
"author": "TomoG",
"version": (1, 0),
"blender": (2, 9, 0),
"location": "",
"description": "sample",
View HatenaSampleCode.html
<div class="box">
<p id="res" class="res">まだクリック無し!</p>
<div class="btn-square">
<p id="btn">ボタン</p>
</div>
</div>
<script>// <![CDATA[
var Value = 0;
document.getElementById("btn").onclick = function() {
View HatenaBodyCode.html
<script>
//実行したいJavaScriptを記載
</script>
<style>
/*実行したいCSSを記載*/
View CreateStartUpForBlenderAddon.py
import bpy
bl_info = {
"name": "SampleAddon",
"author": "Your Name",
"version": (1, 0),
"blender": (2, 80, 2),
"location": "",
"description": "Sample",
"warning": "",
View BlogGetTime.cs
private void TimeNow()
{
DateTime now = DateTime.Now;
int year = now.Year;
//
int month = now.Month;
//
View BlogUnityAssetDataBase5.cs
private void CopyTexture()
{
private Sprite src_Picture;//元の画像
private Sprite dst_Picture;//コピー画像
//コピー先のパスを保存
private string dst_path = AssetDatabase.GetAssetPath(dst_Picture);
//ファイルのコピー
AssetDatabase.CopyAsset(AssetDatabase.GetAssetPath(src_Picture), dst_path);