Metasequoia BBS

| 新規投稿 | 通常表示 | ツリー表示 |
状態
タグ
キーワード
[9662] Script editor / material poperty parameters
対応済み [質問,Who are you?] 返信
how to change material poperty- parameters  when selecting model then it changes all the materials selected object only


for obj in ObjectEnum() do
  mat = MaterialGet(obj)
  MaterialSetAlpha mat, 1.00
  MaterialSetDiffuse mat, 0.80
  MaterialSetEmission mat, 0.75
  MaterialSetSpecular mat, 0.00
  MaterialSetPower mat, 5.00
  MaterialSetAmbient mat, 0.00
  MaterialSetReflection mat, 0.00
  MaterialSetRefraction mat, 1.00
end


Error code
Failed to execute a script in line 1.
Invalid syntax. (invalid syntax)
for obj in ObjectEnum() <<<do
2023-02-09 05:13
[9663] Re: Script editor / 管理者
The 'Script' folder contains several sample Python scripts, so please refer to them first to learn the basics of scripting.
And, the 'Help' menu in the script editor contains descriptions of classes, functions, and properties.
2023-02-09 08:28
[9664] Re: Script editor / material poperty parameters
>The 'Script' folder contains several sample Python scripts, so please refer to them first to learn the basics of scripting.
>And, the 'Help' menu in the script editor contains descriptions of classes, functions, and properties.


But how i do it ? am not coder and its for me imbossibile to change 200-300 materials everytime i import from blender to meta and since i do aterials and i need to change all materials all at once selected object only! :S
2023-02-09 14:22
[9665] Re: Script editor / material poperty parameters
タグが [質問] から [質問,help! ] に変更されました。
>The 'Script' folder contains several sample Python scripts, so please refer to them first to learn the basics of scripting.
>And, the 'Help' menu in the script editor contains descriptions of classes, functions, and properties.

kinda hard tryed many methods but not working idk : S
2023-02-10 06:59
[9666] Re: Script editor / material poperty parameters
タグが [質問,help! ] から [質問,help! i rlly tiered of this] に変更されました。
>The 'Script' folder contains several sample Python scripts, so please refer to them first to learn the basics of scripting.
>And, the 'Help' menu in the script editor contains descriptions of classes, functions, and properties.


import random

doc = MQSystem.getDocument()
objnum = doc.numObject

for oi in range(0,objnum):
    obj = doc.object[oi]
    if obj is None: continue

    if obj.selected:
        mat = obj.material
        mat.ambient = 0.50


Error code


続きを表示...
2023-02-10 11:11
[9667] Re: Script editor / 管理者
What you are asking for is already in the response I have already given, but I will state the same sentence again.

The 'Help' menu in the script editor contains descriptions of classes, functions, and properties.

Please check within the help to see what properties MQObject, MQMaterial, etc. have, and what types they are.
2023-02-10 15:49