anderslanglands / alShaders2

BSD 3-Clause "New" or "Revised" License
75 stars 38 forks source link

2.0.0-beta3 does not work under softimage 2015 #34

Closed rachyid closed 6 years ago

rachyid commented 6 years ago

Hi Cryptomatte 2.00-beta3 does not work with softimage 2015 SP2 WARNING : 3070-SIConnectShaderToCnxPoint - Type mismatch between shader and connection point. no problem with 2.0.0b2

jonahfriedman commented 6 years ago

Interesting. How are you using it in Softimage, and with what version of SitoA?

It requires Arnold 5.0.1, and is meant to be used as an AOV shader. AOV shaders not currently exposed in SitoA, as far as I know, so any use of it would have to be in a way that was not intended.

However, I think it should still work. It is simply an RGBA shader now, which should still work in all contexts that, for example, the "utility" shader still works. What are you trying to plug it into?

rachyid commented 6 years ago

Hi Yes I'm using it with Arnold-5.1.1.0. I edited theses files: ArnoldMenu.js, ArnoldShaderDef.js, ArnoldScenePreferences.js but like I sad the Cryptomatte 2.0.0b3 does not work! Only beta 2. I also edited the cryptomatte.mtd

[node cryptomatte] soft.category STRING "AOV" soft.order STRING "BeginGroup Cryptomatte_Globals Cryptomatte sidecar_manifests cryptomatte_depth strip_obj_namespaces strip_mat_namespaces EndGroup " "BeginGroup Standard_Cryptomatte_AOVs aov_crypto_asset aov_crypto_object aov_crypto_material EndGroup " "BeginGroup User_Defined_Cryptomattes " "BeginGroup User_Cryptomatte0 user_crypto_aov_0 user_crypto_src_0 EndGroup " "BeginGroup User_Cryptomatte1 user_crypto_aov_1 user_crypto_src_1 EndGroup " "BeginGroup User_Cryptomatte2 user_crypto_aov_2 user_crypto_src_2 EndGroup " "BeginGroup User_Cryptomatte3 user_crypto_aov_3 user_crypto_src_3 EndGroup " "EndGroup" desc STRING "Cryptomatte AOV Shader" aov_shader BOOL TRUE c4d.classification STRING "texture" c4d.menu STRING "texture" maya.name STRING "cryptomatte" maya.classification STRING "utility/aov" maya.id INT 0x00116422 houdini.icon STRING "VOP_shadinglayer" houdini.category STRING "AOV" houdini.help_url STRING " http://www.anderslanglands.com/alshaders/cryptomatte.html" houdini.parm.folder.ROOT STRING "Cryptomatte Globals;4;Standard Cryptomatte AOVs;3;User Defined Cryptomattes;12;" houdini.parm.heading.h0 STRING "User Cryptomatte 0" houdini.parm.heading.h1 STRING "User Cryptomatte 1" houdini.parm.heading.h2 STRING "User Cryptomatte 2" houdini.parm.heading.h3 STRING "User Cryptomatte 3" houdini.order STRING " ROOT" houdini.order2 STRING " sidecar_manifests cryptomatte_depth strip_obj_namespaces strip_mat_namespaces" houdini.order3 STRING " aov_crypto_asset aov_crypto_object aov_crypto_material" houdini.order4 STRING " h0 user_crypto_aov_0 user_crypto_src_0 h1 user_crypto_aov_1 user_crypto_src_1 h2 user_crypto_aov_2 user_crypto_src_2 h3 user_crypto_aov_3 user_crypto_src_3"

here are attached file for ArnoldMenu.js, ArnoldShaderDef.js, ArnoldScenePreferences.js

On 29 May 2018 at 15:45, jonahfriedman notifications@github.com wrote:

Interesting. How are you using it in Softimage, and with what version of SitoA?

It requires Arnold 5.0.1, and is meant to be used as an AOV shader. AOV shaders not currently exposed in SitoA, as far as I know, so any use of it would have to be in a way that was not intended.

However, I think it should still work. It is simply an RGBA shader now, which should still work in all contexts that, for example, the "utility" shader still works. What are you trying to plug it into?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anderslanglands/alShaders2/issues/34#issuecomment-392803410, or mute the thread https://github.com/notifications/unsubscribe-auth/AeA2ZoWFWD858M6LsKfhsZbQYSem2aiSks5t3V8WgaJpZM4UPEAD .

jonahfriedman commented 6 years ago

Hi @rachyid,

Your attachments didn't come through, but I don't think I can debug those for you anyway.

The change that seems to be screwing you up is that the shader was changed from a shader with a closure output, to a shader with an RGBA output.

In your modification of the .mtd file, you are not listing all of the parameters that exist, but I suspect that is not the problem.

I don't know where they're trying to plug this in in Software or why it's expecting a closure. Sorry that I'm not of more help.

rachyid commented 6 years ago

Here are the files I edited ArnoldMenu.js function AddShadersSubMenu(in_menu) { in_menu.AddCallbackItem("Standard Surface", "OnShadersMenu"); in_menu.AddCallbackItem("Car Paint", "OnShadersMenu"); in_menu.AddCallbackItem("mix shader", "OnShadersMenu"); in_menu.AddCallbackItem("Standard Hair", "OnShadersMenu"); in_menu.AddCallbackItem("Cryptomatte", "OnShadersMenu");

function OnShadersMenu(in_ctxt) { var item = in_ctxt.Source; switch (item.Name) { case "Standard Surface": SITOA_AddShader("Arnold.standard_surface.1.0", "surface"); break; case "Car Paint": SITOA_AddShader("Arnold.car_paint.1.0", "surface"); break; case "Mix Shader": SITOA_AddShader("Arnold.mix_shader.1.0", "surface"); break; case "Standard Hair": SITOA_AddShader("Arnold.standard_hair.1.0", "surface"); break; case "Cryptomatte": SITOA_AddShader("Arnold.cryptomatte.1.0", "surface"); break;

ArnoldShaderDef.js function XSILoadPlugin( in_reg ) { if (Application.plugins("Arnold Tools") == null) LoadPlugin(XSIUtils.BuildPath(in_reg.OriginPath, "ArnoldTools.js"));

var h = SItoAToolHelper(); h.SetPluginInfo(in_reg, "Arnold");

in_reg.RegisterShader("abs", 1, 0); in_reg.RegisterShader("add", 1, 0); in_reg.RegisterShader("ambient_occlusion", 1, 0); in_reg.RegisterShader("aov_write_float", 1, 0); in_reg.RegisterShader("aov_write_rgba", 1, 0); in_reg.RegisterShader("aov_write_int", 1, 0); in_reg.RegisterShader("aov_write_rgb", 1, 0); in_reg.RegisterShader("cryptomatte", 1, 0);

function XSIUnloadPlugin(in_reg) { return true; } function Arnold_cryptomatte_1_0_DefineInfo(in_ctxt) { return true; } function Arnold_cryptomatte_1_0_Define(in_ctxt) { return true; }

ArnoldScenePreferences.js function CreateRenderChannels() { // Getting list of Available Channels for the Scene // Before creating them, we will check below if each Arnold Render Channel already exists var props = ActiveProject.ActiveScene.PassContainer.Properties; var channels = new ActiveXObject("XSI.Collection"); for (var i=0; i<props.Count; i++) { if(props(i).FullName=="Passes.RenderOptions") var channels = props(i).RenderChannels; }

var aov_array = [];

// aov_array.push({ name: "A", type: siRenderChannelGrayscaleType }); aov_array.push({ name: "AA_inv_density", type: siRenderChannelColorType }); aov_array.push({ name: "albedo", type: siRenderChannelColorType }); aov_array.push({ name: "background", type: siRenderChannelColorType }); aov_array.push({ name: "coat", type: siRenderChannelColorType }); aov_array.push({ name: "coat_albedo", type: siRenderChannelColorType }); aov_array.push({ name: "coat_direct", type: siRenderChannelColorType }); // Cryptomatte aov_array.push({ name: "crypto_asset", type: siRenderChannelColorType }); aov_array.push({ name: "crypto_object", type: siRenderChannelColorType }); aov_array.push({ name: "crypto_material", type: siRenderChannelColorType });

On 29 May 2018 at 17:59, jonahfriedman notifications@github.com wrote:

Hi @rachyid https://github.com/rachyid,

Your attachments didn't come through, but I don't think I can debug those for you anyway.

The change that seems to be screwing you up is that the shader was changed from a shader with a closure output, to a shader with an RGBA output.

In your modification of the .mtd file, you are not listing all of the parameters that exist, but I suspect that is not the problem.

I don't know where they're trying to plug this in in Software or why it's expecting a closure. Sorry that I'm not of more help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/anderslanglands/alShaders2/issues/34#issuecomment-392853942, or mute the thread https://github.com/notifications/unsubscribe-auth/AeA2Zobh5SrHZod5fxzfeb4r57tOCa_vks5t3X5ZgaJpZM4UPEAD .

rachyid commented 6 years ago

here is the link for images https://we.tl/i2mBODQfDj

rachyid commented 6 years ago

all the parameter are listed in cryptomatte matching 100% with Maya, I'm showing only the top, you can see it in the attached image (link preview post) and here is for beta 2.0.0b3, same thing I'm Showing only the top [node cryptomatte] soft.category STRING "AOV" soft.order STRING "BeginGroup Cryptomatte_Globals Cryptomatte sidecar_manifests cryptomatte_depth strip_obj_namespaces strip_mat_namespaces EndGroup " "BeginGroup Standard_Cryptomatte_AOVs aov_crypto_asset aov_crypto_object aov_crypto_material EndGroup " "BeginGroup Name_processing_Options " "BeginGroup ___ preview_in_exr process_paths process_obj_path_pipes process_maya process_mat_path_pipes process_legacy EndGroup "
"EndGroup " "BeginGroup User_Defined_Cryptomattes " "BeginGroup User_Cryptomatte0 user_crypto_aov_0 user_crypto_src_0 EndGroup " "BeginGroup User_Cryptomatte1 user_crypto_aov_1 user_crypto_src_1 EndGroup " "BeginGroup User_Cryptomatte2 user_crypto_aov_2 user_crypto_src_2 EndGroup "
"BeginGroup User_Cryptomatte3 user_crypto_aov_3 user_crypto_src_3 EndGroup "
"EndGroup" desc STRING "Cryptomatte AOV Shader" aov_shader BOOL TRUE c4d.classification STRING "texture" c4d.menu STRING "texture" soft.category STRING "AOV" maya.name STRING "cryptomatte"

jonahfriedman commented 6 years ago

Sorry @rachyid, I can't help you with your code.

The important change here is that it's now an RGBA shader, like "utility", and not a closure shader, like "standard_surface". Cryptomatte's output should not be a closure, so perhaps there's a bug in how you're creating the shader definition. Are you using the SPDL it comes with?

rachyid commented 6 years ago

No I'm not using SPDL I put the mtd and the dll file into C:\Users\rachid\Autodesk\Softimage_2015_R2-SP2\Addons\SItoA\Application\Plugins\bin\nt-x86-64

jonahfriedman commented 6 years ago

OK, two things:

  1. Cryptomatte is not a closure shader anymore as of Beta 3, and I strongly suspect that's what is causing your problems. Since you are creating your own shader definitions, you probably need to fix this somewhere and I don't know where, and sorry I can't support your code. The closure node in your screenshot should not be necessary. The Cryptomatte shader should behave like an RGBA shader (like utility) and not a closure shader (like standard surface), as I said before.
  2. You do not have all of the shader parameters in your .mtd file, there were new ones added in Beta 3 that you don't have, for example "process_paths". The full list is here, for reference.

I hope that helps you with your code.

rachyid commented 6 years ago

The process_paths still there it just renamed to Path-Style names to match Maya Attribute Editor here is the code for the Utility Shader case "Utility": SITOA_AddShader("Arnold.utility.1.0", null); break; so I dit the same thing with Cryptomatte case "Cryptomatte": SITOA_AddShader("Arnold.cryptomatte.1.0", null);
break; but the same thing, does not work, do you have a test scene, just with 03 spheres that using cryptomatte?

jonahfriedman commented 6 years ago

No, I have not used Softimage in a long time. I think if the SPDL doesn't work for you we'll try to look into that, but unfortunately making your own definitions, you're on your own.

Please do report back if you figure it out, the info might help someone else.

rachyid commented 6 years ago

I'll try to solve the pb, if I can't I'll use Cryptomatte beta 2.0 Thank you JonahFriedman for you help

rachyid commented 6 years ago

finally I get it to work Download here: http://www.si-community.com/community/download/file.php?id=4584 Video here: https://www.youtube.com/watch?v=cpeuaompWIQ&t=96s Any Idea on how to implement the Operator Node?

jonahfriedman commented 6 years ago

Glad to hear you worked it out.

For operator nodes, I think that's probably a big project which involves adding features to the SitoA c++ code.

rachyid commented 6 years ago

Hope someone of the team are working on

jonahfriedman commented 6 years ago

SitoA is an open source project now, and you can see its progress over here:

https://github.com/Autodesk/sitoa/

rachyid commented 6 years ago

Yes, but no operator node, no contour filter, no noice