魔法のメモ

CG N GAME BLOG

2021-01-01から1年間の記事一覧

Python_15.速習_break文、continue文(for 文)

#break文(繰り返しを辞めたい場合) #continue文(スキップしたい場合) for i in range(10): if i==7: break print(i) 0 1 2 3 for i in range(10): if i==7: continue print(i) 0 1 2 3 4 5 6 7 8 9 コードテキスト

Python_15.速習_Zip関数、Enumerate関数(for 文)

last_names =['五十嵐','五条','掛布','ランディー','岡田'] middle_names =['TT','ジョー','タイガー','龍','aka'] first_names =['たけし','悟','ひろし','バース','譲司'] for last_name,middle_name,first_name in zip(last_names,middle_names,first_na…

Python_15.速習_繰り返し処理(for 文)

iはindex (英語はnとかでも大丈夫) names=['佐藤','井田','掛布','バース','岡田','阿部','武田'] #print(names[0]+'さん') #print(names[1]+'さん') #面倒くさい、、、 len(names) #namesの長さ 7 for i in range (len(names)): print(names[i]+'さん') 佐…

Python_15.速習_if文

money = 3000 if money >= 8000: print('映画館へ行く') else: print('映画館には行かない') 映画館には行かない money = 1000 if money >= 8000: print('ディズニーへ行く') elif money >=2000: print('映画館に行きます') elif money ==1000: print('ちょ…

Python_15.速習_辞書

scores=[40,90,80,80,70] scores={'国語':40, '数学':90, '英語':80, '理科':80, '社会':70 } print(scores) scores['国語'] scores['家庭科'] =100 scores['体育'] =10 print(scores) scores.pop('体育') scores {'国語': 40, '数学': 90, '英語': 80, '理…

Python_15.速習_リスト

〇リスト ■ names=['おしるこ','グーグル','ブック','あなご'] print(names[1]) print(names[0]) print(names[-1]) print(names[0:3]) # 3(あなご)の一つ前から取得する print(names) print(names[:]) print(names[:2]) print(names[1:]) グーグル おしるこ …

Python_15.速習_比較演算子

〇比較演算子 ■10%3 #10割る3は余り1 1 ■3**3 #3の3乗 27 ■#変数 #大文字、小文字は区別される #数字、一部の記号は先頭の文字にできない#01moji#\moji #予約語は使用できない#and#True など既にPythonで使用されてる文字 #命名規則#my_name #famousu_city…

Python_14.GUI_TKinter

https://flytech.work/blog/16310/#i-2

Python_14.GUI_pysimplegui

Python_13.△コンポーネントに指定したテクスチャの挿入

# -*- coding: utf-8 -*- import engine.cmds as cmds path= 'systems/rendering/12_vosselaar_house_living.dds'; asset= cmds.findAsset( path ); go= cmds.createGameObject('IBL'); ibl= cmds.addComponent(go, 'IBL'); if asset!= None:ibl.IBLTextureR…

Python_12.名前変更

# -*- coding: utf-8 -*- import engine.cmds as cmds # create object hero = cmds.createGameObject('hero'); # set value (direct) hero.Name = 'herohero' #これは後述で上書きされる # set value (use method) hero.SetPropertyValue('Name', 'herohero…

Python_11.コンポーネントの一覧表示

# -*- coding: utf-8 -*- import engine.cmds as cmds # you can get creatable component name list # componentNames = cmds.getComponentNames(); # print component names cmds.printComponents();

Python_10.コンポーネントのRemove

# -*- coding: utf-8 -*- import engine.cmds as cmds # create game go = cmds.createGameObject('GameObject'); # add Component primitive = cmds.addComponent(go, "Primitive"); mesh = cmds.addComponent(go, "Mesh"); # remove Component cmds.delete…

Python_9.オブジェクトのDelete

# -*- coding: utf-8 -*- import engine.cmds as cmds # create game object parent = cmds.createGameObject( 'Parent' ) parent.Transform.LocalPosition = vec3(10, 20, 30) parent.Transform.LocalScale = vec3(1, 2, 3) # delete game object cmds.dele…

Python_8.タイプ、ネーム、パスの取得

# -*- coding: utf-8 -*- import engine.cmds as cmds import engine.wpf as wpf texture = cmds.findAsset( 'assets:/systems/rendering/ColorCubeLinear.dds' ) behavior = cmds.findAsset( 'assets:/systems/script/Behavior.template.cs' ) print textur…

Python_7.位置、回転、大きさ

#-*- coding: utf-8 -*- import engine.cmds as cmds import engine.wpf as wpf from via import vec3 from via import Color # write your code here parent = cmds.createGameObject( 'Parent' ) parent.Transform.LocalPosition = vec3(10, 20, 30) paren…

Houdini_APIに関して

qiita.com

Python_UE4_Unrealとの連携

Python_6.Prefabとして保存する

# -*- coding: utf-8 -*- import engine.cmds as cmds obj = cmds.createGameObject('PrefabSample') path = 'Test/Section/VFX/名前' cmds.toPrefab(obj, path) -- ■Test/Section/VFX/名前 assets:/Test/Section/VFX/名前 ←でもOK ※フォルダは事前に作して…

Python_5.子GameObjectの作成

# -*- coding: utf-8 -*- import engine.cmds as cmds ​ parentGO = cmds.createGameObject('ParentObject') childGO = cmds.createGameObject('ChildObject', parentGO) -- ■createGameObjectコマンドの第二引数に親GameObjectを指定することで、その子Game…

Python_4.Componentを追加

# -*- coding: utf-8 -*- import engine.cmds as cmds ​ go = cmds.createGameObject('addMesh') cmds.addComponent(go, 'Mesh') -- ■go = cmds.createGameObject('addMesh') createGameObjectマクロコマンドの第一引数で生成するGameObjectの名前を設定 ■cm…

Python_3.GameObjectのプロパティを知るには

#-*- coding: utf-8 -*- import engine.cmds as cmds ​ go = cmds.createGameObject() print go.Properties -- ■GameObjectのTransformにアクセスしたい場合は以下のように書く go.Transform ■Transformのプロパティを知りたい場合 print go.Transform.Prope…

Python_2.生成したGameObjectを編集する

#-*- coding: utf-8 -*-import engine.cmds as cmdstest = cmds.createGameObject()test.Name = 'Homehome' ■test = cmds.createGameObject() ソースコードを次のように書き換えることで、生成されたGameObjectを取得することができます。 testは変数です。 …

Python_1.GameObject、FolderObjectを生成

#-*- coding: utf-8 -*-import engine.cmds as cmdscmds.createFolderObject()cmds.createGameObject() ■このソースコードがutf-8でエンコードされることを示している #-*- coding: utf-8 -*- ■このソースコードでマクロコマンドを実行するために必要な情報…

Zbrush_眼鏡

https://firestorage.jp/download/6cd73134fa87d8b24573fa98468fedef6289aa35 https://firestorage.jp/download/a7d6036cdc50fa5dccfc1ca2eccbbd0dc3b1a356 https://firestorage.jp/download/c0483206e4453a4d2edd11f3b5a2abff967aaab1 https://firestorage.…

Zbrush_ヘアーブラシ

Zbrush_リファレンス画像表示

1.Draw<正面とサイドに画像を張り付ける 2.カメラのパースペクティブをオフ mononoco.com \\ error zbrushcentral.jp

Houdini_煙をメッシュ化

c_煙をメッシュ化 Friday, July 5, 2019 1:04 PM

Houdini_寿命

a_寿命 Friday, June 14, 2019 5:37 PM i@id = @ptnum; float r = rand(@id); f@death_flame = 30+60* r; f@life = f@death_flame / 30; i@id = @ptnum; float r = rand(@id); float minf = chf('death_flame_min'); float maxf = chf('death_flame_max'); f…

Houdini_アレンビック書き出し

a_アレンビック書き出し_02 Wednesday, June 5, 2019 9:39 AM import maya.cmds names = maya.cmds.ls(sl=True) def ContinuousDuplicate(): sf = int(cmds.playbackOptions(q=True,min=True)) ef = int(cmds.playbackOptions(q=True,max=True)) #何フレーム…