I work in layers, so everything has a place. I found a script that will assign an Object ID to everything on each layer, which is AWESOME. Now I want to automate the MultiMatteElement creation. I have 22 layers, so instead of creating 22 MultiMatteElement manually, typing the next three Object ID numbers in each MultiMatteElement, how can that be automated? Is this wishful thinking?
Announcement
Collapse
No announcement yet.
MultiMatteElement
Collapse
X
-
MultiMatteElement
Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Tags: None
-
This might do what you're looking for.
https://www.pixamoon.com/shop/458756...anizer/9332487
Comment
-
I saw that, but I don't need material ID's, I need Object ID.Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
Here you go... Just change the "MMEnumber" to the number of objectID channels you need and execute the script. I'd recommend trying in an empty file first.
Code:--setMMEnumber to desired number of ObjectID's MMEnumber=0 re = maxOps.GetCurRenderElementMgr() el = multimatteelement if MMEnumber>0 then ( for i = 1 to MMEnumber by 3 do ( reName="MME " + i as string + "-"+ ((i +2) as string) re.addrenderelement (el elementname:(reName) R_gbufID:(i) R_gbufIDOn:(on) G_gbufID:(i+1) G_gbufIDOn:(on) B_gbufID:(i+2) B_gbufIDOn:(on) ) ) )
Last edited by dlparisi; 30-10-2020, 03:04 PM.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
I will try that. I lost the script I found to do the Object ID by layer. I'll look for that again and give your script a try.Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
I get this
-- Syntax error: at ), expected <factor>
-- In line: )Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
Here is the script that allowed me to create Object ID's for everything on each layer.
(
try(destroyDialog Test)catch()
rollout LayerMultiMatte "Layer MultiMattes" width:162 height:77
(
button 'Create_Btn' "Button" pos:[10,16] width:142 height:43 align:#left
fn GetUsedGBufferChannels sel =
(
MakeUniqueArray (for o in (if sel == false then objects else selection) where o.gbufferchannel != 0 collect o.gbufferchannel)
)
fn GetLayerNameByGBufferChannel index =
(
local layer_name
for o in objects while layer_name == undefined where o.gbufferChannel == index do layer_name = o.layer.name
layer_name
)
fn setLayerObjID ignoreEmptyLayersn =
(
local getlayer = LayerManager.getlayer, layer, idx = 0
if not ignoreEmptyLayers then
(
for i = 0 to layerManager.count-1 where ((layer = getlayer i).nodes &objs; objs).count > 0 do objs.gbufferChannel = i+1
)
else
(
for i = 0 to layerManager.count-1 where ((layer = getlayer i).nodes &objs; objs).count > 0 do objs.gbufferChannel = (idx+=1)
)
)
on Create_Btn pressed do
(
setLayerObjID() -- this will ignore empty layer (id order 1,2,3,4,5 ...)
if matchpattern (renderers.current as string) pattern:"V-Ray*" == true then
(
re = maxOps.GetCurRenderElementMgr()
VRay_mask_elements = for i=0 to re.NumRenderElements() where classof (re.GetRenderElement i) == MultiMatteElement collect re.GetRenderElement i
for gbuffer_index in GetUsedGBufferChannels false do
(
exclude = false
for m in VRay_mask_elements where m.R_gbufID == gbuffer_index do exclude = true
if not exclude then
(
layer_name = GetLayerNameByGBufferChannel gbuffer_index
mm = MultiMatteElement elementName:layer_name R_gbufIDOn:true R_gbufID:gbuffer_index G_gbufIDOn:false G_gbufID:0 B_gbufIDOn:false B_gbufID:0
re.AddRenderElement mm
)
)
)
)
)
createDialog LayerMultiMatte
)Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
Originally posted by glorybound View PostI get this
-- Syntax error: at ), expected <factor>
-- In line: )www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
Okay, that worked. I am not sure if it was I didn't have it highlighted or the keypad enter. However, I got that far with the other script. I was hoping to get something to make the many MultiMatteElement
elements. Right now I have to make 23 MultiMatteElement and change the RBG digits in each one. It isn't the end of the world, but that will be a pain.Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
The Power Mask script does it, but not with G-buffer.Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
Originally posted by glorybound View PostOkay, that worked. I am not sure if it was I didn't have it highlighted or the keypad enter. However, I got that far with the other script. I was hoping to get something to make the many MultiMatteElement
elements. Right now I have to make 23 MultiMatteElement and change the RBG digits in each one. It isn't the end of the world, but that will be a pain.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
It didn't do anything for me. I did find a script that worked.Bobby Parker
www.bobby-parker.com
e-mail: info@bobby-parker.com
phone: 2188206812
My current hardware setup:- Ryzen 9 5900x CPU
- 128gb Vengeance RGB Pro RAM
- NVIDIA GeForce RTX 4090
- Windows 11 Pro
Comment
-
Did you change the "MMEnumber" in the script? Otherwise it won't do anything.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
Comment