失敗したからって、それがどうしたというのだ。
Tweet
2012年1月9日月曜日
Houdini POPs Breaking System (with 2nd and 3rd fracturing)
http://vimeo.com/34260583
HoudiniのPopsで2次破壊3次破壊をコントロールするシステムを作ってみました。
DOPsに自動で衝突時に破片を作ってくれるノードもあるのですが、重い、プラス衝突時のみの
機能なので、条件を設定する事が出来ません。
破片の形状をボロノイ拡張した仕組みにしたので、Houdiniならではのディールを持てる
仕組みに出来たと思います。
Tweet
HoudiniのPopsで2次破壊3次破壊をコントロールするシステムを作ってみました。
DOPsに自動で衝突時に破片を作ってくれるノードもあるのですが、重い、プラス衝突時のみの
機能なので、条件を設定する事が出来ません。
破片の形状をボロノイ拡張した仕組みにしたので、Houdiniならではのディールを持てる
仕組みに出来たと思います。
Tweet
2012年1月3日火曜日
謹賀新年
明けましておめでとうございます。
さて、あっという間に1年が経っちゃいました。
色々振り返ると、去年は色々身の回りの環境が変わった年で、
意識はなかったけれど、少し守りに入ってしまったような気もします。
悪い癖で、何か行動する前に考え過ぎてしまって行動が鈍るとこもあります。
今年は積極的に、まずは行動出来たらと思います。
そういえば、昨年知った大前研一さんの名言があります。
人間が変わる方法は3つしかない。
1番目は時間配分を変える。
2番目は住む場所を変える。
3番目はつきあう人を変える。
この3つの要素でしか人間は変わらない。
最も無意味なのは『決意を新たにする』ことだ。
3つの方法は、なるほど便利だなと思い、上手く利用出来たらとも思いますが、
決意も継続は力なりで意識して行動すれば、自分を変える事も可能だと思います。
最近深く心に刻んでいる事があって、
どのジャンルでも一流の人は人並み外れた努力しているという事、
そして自分を信じている事。
この業界に10年以上いて、天才と思った人は3人いましたが、皆どこかで努力していて、
そして迷いが無い人達でした。
自分もその方々に近づけるよう、今年も自分を信じてやっていこうと思います。
本年もよろしくお願いします!
Tweet
さて、あっという間に1年が経っちゃいました。
色々振り返ると、去年は色々身の回りの環境が変わった年で、
意識はなかったけれど、少し守りに入ってしまったような気もします。
悪い癖で、何か行動する前に考え過ぎてしまって行動が鈍るとこもあります。
今年は積極的に、まずは行動出来たらと思います。
そういえば、昨年知った大前研一さんの名言があります。
人間が変わる方法は3つしかない。
1番目は時間配分を変える。
2番目は住む場所を変える。
3番目はつきあう人を変える。
この3つの要素でしか人間は変わらない。
最も無意味なのは『決意を新たにする』ことだ。
3つの方法は、なるほど便利だなと思い、上手く利用出来たらとも思いますが、
決意も継続は力なりで意識して行動すれば、自分を変える事も可能だと思います。
最近深く心に刻んでいる事があって、
どのジャンルでも一流の人は人並み外れた努力しているという事、
そして自分を信じている事。
この業界に10年以上いて、天才と思った人は3人いましたが、皆どこかで努力していて、
そして迷いが無い人達でした。
自分もその方々に近づけるよう、今年も自分を信じてやっていこうと思います。
本年もよろしくお願いします!
Tweet
2011年12月14日水曜日
scriptのすすめ9 ~if文、spinner、radio button~ maxscript tips
日本語Ver張り忘れていました。。
Before I revise last code, I will show you how to use "if" and "else".
Here is a simple example.
a = 1
if a == 1 then
(
print "a is one"
)
else
(
print "a is not one"
)
--------------------------------------------------------------------------------------------------------------------------------------
when we want to separate some actions,we use if and else.
if you change "a = 1" to "a = 5","a is not one" will be printed on lisner.
So,this time I'll show you how to use "Spinner" and "radioButtons".
First let's make a radio button to choose geometry.
Here is an example.

rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 100
--------------------------------------------------------------------------------------------------------------------------------------
I added 2 UI parts and modify some code.
First one is a radio button.
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
"rad_type" is the radio button's name whitch is used for access its state.
if you choose "Box", it will return 1, if you choose "Sphere", it will return 2,if you choose "Teapot"it will return 3.
We can access the number by using ".state".
radio buttons is for just returning a number whitch button is selected.
spinner spn_size "Size:" range:[0, 10000, 25]
"spn_size" is the spineer"s name whitch is used for access its value is the same as radio buttons.
spineer needs 3 numbers,in this case,"0" is minimum value of this spinner,"10000" is maximum value and 25 is default value.
We can access the spinner's value by using ".value".
Lastly let's add spinners to control how many objects is created along the each axis.
--------------------------------------------------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
spinner spn_x "X:" type:#integer range:[1, 10000, 10]
spinner spn_y "Y:" type:#integer range:[1, 10000, 10]
spinner spn_z "Z:" type:#integer range:[1, 10000, 10]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to spn_x.value do
(
for j =1 to spn_y.value do
(
for k=1 to spn_z.value do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 170
--------------------------------------------------------------------------------------------------------------------------------------
That's it this time.
See you then, next time!!
Thank you.
--------------------------------------------------------------------------------------------------------------------------------------
前回のコードを拡張していく前に、if文elseの使い方を説明しておこうと思います。
こちら、簡単な例です。
a = 1
if a == 1 then
(
print "a is one"
)
else
(
print "a is not one"
)
--------------------------------------------------------------------------------------------------------------------------------------
a が1のときは、a is one それ以外のときは,"a is not one"とプリントされます。
何かの条件で分岐したいときに使うというだけです。
試しにa=1 をa = 5に変えてみると、,"a is not one"とプリントされると思います。
では、ここからはスピナーとラジオボタンの使い方を説明しようと思います。
まずは、ジオメトリを選ぶ為のラジオボタンを作ってみようと思います。
例です。

rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 100
--------------------------------------------------------------------------------------------------------------------------------------
2つのUIと少しコードを足してみました。
1つ目はラジオボタンです。
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
"rad_type" はこのラジオボタンの名前でどの状態にあるか取得する為に使います。
"Box"を選択していれば1を返し、"Sphere"なら 2、"Teapot"なら3の値を返します。
".state"を使って、このラジオボタンにアクセスできます。
ラジオボタンはただどのボタンが選択されているか、ということをナンバーで返すものです。
spinner spn_size "Size:" range:[0, 10000, 25]
"spn_size" はこのスピナの名まで、ラジオボタン同様値を得る為に使います。
"0"は最小値"10000"最大値で 25はデフォルトの値です。
スピナの値には".value"を使ってアクセスできます。
最後に、軸それぞれに幾つオブジェクトを並べるか決めるスピナーを追加してみましょう。
--------------------------------------------------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
spinner spn_x "X:" type:#integer range:[1, 10000, 10]
spinner spn_y "Y:" type:#integer range:[1, 10000, 10]
spinner spn_z "Z:" type:#integer range:[1, 10000, 10]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to spn_x.value do
(
for j =1 to spn_y.value do
(
for k=1 to spn_z.value do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 170
--------------------------------------------------------------------------------------------------------------------------------------
今回は以上です。
ではでは、また次回。
Tweet
Before I revise last code, I will show you how to use "if" and "else".
Here is a simple example.
a = 1
if a == 1 then
(
print "a is one"
)
else
(
print "a is not one"
)
--------------------------------------------------------------------------------------------------------------------------------------
when we want to separate some actions,we use if and else.
if you change "a = 1" to "a = 5","a is not one" will be printed on lisner.
So,this time I'll show you how to use "Spinner" and "radioButtons".
First let's make a radio button to choose geometry.
Here is an example.

rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 100
--------------------------------------------------------------------------------------------------------------------------------------
I added 2 UI parts and modify some code.
First one is a radio button.
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
"rad_type" is the radio button's name whitch is used for access its state.
if you choose "Box", it will return 1, if you choose "Sphere", it will return 2,if you choose "Teapot"it will return 3.
We can access the number by using ".state".
radio buttons is for just returning a number whitch button is selected.
spinner spn_size "Size:" range:[0, 10000, 25]
"spn_size" is the spineer"s name whitch is used for access its value is the same as radio buttons.
spineer needs 3 numbers,in this case,"0" is minimum value of this spinner,"10000" is maximum value and 25 is default value.
We can access the spinner's value by using ".value".
Lastly let's add spinners to control how many objects is created along the each axis.
--------------------------------------------------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
spinner spn_x "X:" type:#integer range:[1, 10000, 10]
spinner spn_y "Y:" type:#integer range:[1, 10000, 10]
spinner spn_z "Z:" type:#integer range:[1, 10000, 10]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to spn_x.value do
(
for j =1 to spn_y.value do
(
for k=1 to spn_z.value do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 170
--------------------------------------------------------------------------------------------------------------------------------------
That's it this time.
See you then, next time!!
Thank you.
--------------------------------------------------------------------------------------------------------------------------------------
前回のコードを拡張していく前に、if文elseの使い方を説明しておこうと思います。
こちら、簡単な例です。
a = 1
if a == 1 then
(
print "a is one"
)
else
(
print "a is not one"
)
--------------------------------------------------------------------------------------------------------------------------------------
a が1のときは、a is one それ以外のときは,"a is not one"とプリントされます。
何かの条件で分岐したいときに使うというだけです。
試しにa=1 をa = 5に変えてみると、,"a is not one"とプリントされると思います。
では、ここからはスピナーとラジオボタンの使い方を説明しようと思います。
まずは、ジオメトリを選ぶ為のラジオボタンを作ってみようと思います。
例です。

rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 100
--------------------------------------------------------------------------------------------------------------------------------------
2つのUIと少しコードを足してみました。
1つ目はラジオボタンです。
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
"rad_type" はこのラジオボタンの名前でどの状態にあるか取得する為に使います。
"Box"を選択していれば1を返し、"Sphere"なら 2、"Teapot"なら3の値を返します。
".state"を使って、このラジオボタンにアクセスできます。
ラジオボタンはただどのボタンが選択されているか、ということをナンバーで返すものです。
spinner spn_size "Size:" range:[0, 10000, 25]
"spn_size" はこのスピナの名まで、ラジオボタン同様値を得る為に使います。
"0"は最小値"10000"最大値で 25はデフォルトの値です。
スピナの値には".value"を使ってアクセスできます。
最後に、軸それぞれに幾つオブジェクトを並べるか決めるスピナーを追加してみましょう。
--------------------------------------------------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
radiobuttons rb_type labels:#( "Box","Sphere","Teapot")
spinner spn_size "Size:" range:[0, 10000, 25]
spinner spn_x "X:" type:#integer range:[1, 10000, 10]
spinner spn_y "Y:" type:#integer range:[1, 10000, 10]
spinner spn_z "Z:" type:#integer range:[1, 10000, 10]
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
if rb_type.state == 1 do
(
b = box length:spn_size.value width:spn_size.value height:spn_size.value
)
if rb_type.state == 2 do
(
b = sphere radius:(spn_size.value/2)
)
if rb_type.state == 3 do
(
b = teapot radius:(spn_size.value/2)
)
for i = 1 to spn_x.value do
(
for j =1 to spn_y.value do
(
for k=1 to spn_z.value do
(
ib = instance b
ib.pos = [i,j,k]*spn_size.value
)
)
)
delete b
)
)
createdialog myUI 240 170
--------------------------------------------------------------------------------------------------------------------------------------
今回は以上です。
ではでは、また次回。
Tweet
2011年11月29日火曜日
2011年11月28日月曜日
2011年11月25日金曜日
scriptのすすめ8 ~UIの基本~ maxscript tips
It's been a while again (^^;)
This time I will explain how to make UI.
First I will show you the simpliest example.

----------------------------------------------
rollout myUI "simpleUI"
(
)
createdialog myUI 240 80
----------------------------------------------
"rollout" and "createdialog" is a minimum of set to create UI.
"myUI" is this window's name you can use any words and "simpleUI" is a label which you want show on the Bar.
"createdialog" makes a dialog which is defined by "rollout" and you can specify size of the dialog.
As above example width is 240 and height is 120.
Next let's make a button on this UI when you press it something will happen.

----------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
)
createdialog myUI 240 80
----------------------------------------------
"button" needs two parameters which are name of the button and text on the button.
"width" and "height" is not always necessary because it has default value.
That completed making UI however if you press the button nothing happen.
So let's meke some processings when you press "myBtn".
--------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
b = box()
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*25
)
)
)
delete b
)
)
createdialog myUI 240 80
--------------------------------------------------------------------------------------------
I added "on myBtn pressed do......".
Below "on myBtn pressed do" is the processing when you press the button.
I used for loop 3 times, I think this is little bit complicated but it's buildup of previous my post.
This is the result.

That's all this time.
I will revise this next time.
See you then, thak you!
----------------------------------------------------------------------------
またまた時間が空いてしまいました。
今回は、UIの作り方を説明できたらと思います。
まずは一番シンプルなUIのサンプルを。

----------------------------------------------
rollout myUI "simpleUI"
(
)
createdialog myUI 240 80
----------------------------------------------
"rolleout"と"createdialog" はUIを作るうえで最低限のセットで、myUIはこのウィンドウ(ロールアウト)の名前です。どんな名前でも付けれます。
"simpleUI"の部分はこのUIに表示する名札のようなものです。
"createdialog" は"rolleout"で定義したダイアログを作るメソッドで、サイズも指定できます。
上の例では、幅240高さ80です。
次にここに押したら何かが起きるボタンを作ってみましょう。

----------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
)
createdialog myUI 240 80
----------------------------------------------
"button"は2つのパラメータが必要で、このボタンの名前と表示するテキストです。
widthとheigthは必ずしも必要では無いです。無ければ、デフォルト値が設定されます。
これで、UIは完成しましたが、ボタンを押しても何もおきません。
では、ボタンをおしたら何かの処理が行われるようにしましょう。
--------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
b = box()
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*25
)
)
)
delete b
)
)
createdialog myUI 240 80
--------------------------------------------------------------------------------------------
"on myBtn pressed do......".以下を足しました。
on myBtn pressed do から下の部分が、myBtnを押した時に行われる処理です。
処理の中身はforループを3回使用して少しトリッキーですが、前回の発展系です。
結果は以下のとおり。

今回は以上で。
次はこれの発展と他の機能を紹介でしたらと思います。
ではでは。
Tweet
This time I will explain how to make UI.
First I will show you the simpliest example.

----------------------------------------------
rollout myUI "simpleUI"
(
)
createdialog myUI 240 80
----------------------------------------------
"rollout" and "createdialog" is a minimum of set to create UI.
"myUI" is this window's name you can use any words and "simpleUI" is a label which you want show on the Bar.
"createdialog" makes a dialog which is defined by "rollout" and you can specify size of the dialog.
As above example width is 240 and height is 120.
Next let's make a button on this UI when you press it something will happen.

----------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
)
createdialog myUI 240 80
----------------------------------------------
"button" needs two parameters which are name of the button and text on the button.
"width" and "height" is not always necessary because it has default value.
That completed making UI however if you press the button nothing happen.
So let's meke some processings when you press "myBtn".
--------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
b = box()
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*25
)
)
)
delete b
)
)
createdialog myUI 240 80
--------------------------------------------------------------------------------------------
I added "on myBtn pressed do......".
Below "on myBtn pressed do" is the processing when you press the button.
I used for loop 3 times, I think this is little bit complicated but it's buildup of previous my post.
This is the result.

That's all this time.
I will revise this next time.
See you then, thak you!
----------------------------------------------------------------------------
またまた時間が空いてしまいました。
今回は、UIの作り方を説明できたらと思います。
まずは一番シンプルなUIのサンプルを。

----------------------------------------------
rollout myUI "simpleUI"
(
)
createdialog myUI 240 80
----------------------------------------------
"rolleout"と"createdialog" はUIを作るうえで最低限のセットで、myUIはこのウィンドウ(ロールアウト)の名前です。どんな名前でも付けれます。
"simpleUI"の部分はこのUIに表示する名札のようなものです。
"createdialog" は"rolleout"で定義したダイアログを作るメソッドで、サイズも指定できます。
上の例では、幅240高さ80です。
次にここに押したら何かが起きるボタンを作ってみましょう。

----------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
)
createdialog myUI 240 80
----------------------------------------------
"button"は2つのパラメータが必要で、このボタンの名前と表示するテキストです。
widthとheigthは必ずしも必要では無いです。無ければ、デフォルト値が設定されます。
これで、UIは完成しましたが、ボタンを押しても何もおきません。
では、ボタンをおしたら何かの処理が行われるようにしましょう。
--------------------------------------------------------------------------------------------
rollout myUI "simpleUI"
(
button myBtn "Do!!" width:200 height:50
on myBtn pressed do
(
b = box()
for i = 1 to 10 do
(
for j =1 to 10 do
(
for k=1 to 10 do
(
ib = instance b
ib.pos = [i,j,k]*25
)
)
)
delete b
)
)
createdialog myUI 240 80
--------------------------------------------------------------------------------------------
"on myBtn pressed do......".以下を足しました。
on myBtn pressed do から下の部分が、myBtnを押した時に行われる処理です。
処理の中身はforループを3回使用して少しトリッキーですが、前回の発展系です。
結果は以下のとおり。

今回は以上で。
次はこれの発展と他の機能を紹介でしたらと思います。
ではでは。
Tweet
2011年11月3日木曜日
登録:
投稿
(
Atom
)

