Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBR Errors Picking Textures #146

Open
Spkopach opened this issue Nov 23, 2020 · 7 comments
Open

PBR Errors Picking Textures #146

Spkopach opened this issue Nov 23, 2020 · 7 comments

Comments

@Spkopach
Copy link

Hey Guys,

Running Maya 2019.2 and the most recent exporter 1.2.1

I use the assign PBR to my selected object. I select textures you use as reference with the helmet and I get these errors in console.

defaultNavigation -force true -connectToExisting -source file1 -destination GLSLShader2.u_BaseColorTexture;
// Error: line 0: No object matches name: GLSLShader2.u_BaseColorTexture //

When trying to apply the Default_albedo.jpg in the reference.

Best
-Sk

@ziriax
Copy link
Contributor

ziriax commented Nov 24, 2020

Thanks for trying the latest pre-release of Maya2glTF!

I'm not sure where you found the Default_albedo.jpg file, it is not part of this repository.

The textures of the damaged helmet are:

maya\images\damaged_helmet_metallic.jpg
maya\images\damaged_helmet_normal.png
maya\images\damaged_helmet_roughness.jpg
maya\images\damaged_helmet_albedo.jpg
maya\images\damaged_helmet_emissive.jpg

So unfortunately I can't reproduce your problem.

Could you try to do the same with the SimpleCube1.ma scene in this repository (see maya/scenes), and those textures?

@Spkopach
Copy link
Author

Sure, I will test it with the assets you mentioned. Will post my results here. Thank you for the speedy response!

@Spkopach
Copy link
Author

So wasnt able to find the simple.ma scene. In your files there was only a simple.ma.swatches.

So just dropped a cube into a default scene then ran the script to pull up the GLTF export UI
Selected cube and assign PBR shader
Then selected all the reference source files

Got these errors in console

polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
// Result: pCube1 polyCube1 //
select -cl ;
select -r pCube1 ;
Using glTF PBR shader from your home directory:
C:/Users/spkopach/Documents/maya/maya2glTF/PBR/shaders/glTF_PBR.ogsfx
// Warning: file: C:/Users/spkopach/Documents/maya/2019/scripts/maya2glTF_assignPbrShader.mel line 94: Plug-in, "glslShader.mll", is already loaded. Skipped. //
connectAttr -f GLSLShader1.outColor GLSLShader1SG.surfaceShader;
// Result: Connected GLSLShader1.outColor to GLSLShader1SG.surfaceShader. //
sets -e -forceElement GLSLShader1SG;
// Result: GLSLShader1SG //
// Created shader GLSLShader and assigned to the selected objects. //
Using 'G:/Maya_Projects/Hiro_Maya_Template_Master/sourceimages/Transition_Animations_Textures/Source_Assets' as next texture folder
'g:/maya_projects/hiro_maya_template_master/sourceimages/transition_animations_textures/source_assets/damaged_helmet_albedo.jpg' matched texture pattern 'albedo'
shadingNode -asTexture -isColorManaged file;
// Result: file1 //
shadingNode -asUtility place2dTexture;
// Result: place2dTexture1 //
connectAttr -f place2dTexture1.coverage file1.coverage;
// Result: Connected place2dTexture1.coverage to file1.coverage. //
connectAttr -f place2dTexture1.translateFrame file1.translateFrame;
// Result: Connected place2dTexture1.translateFrame to file1.translateFrame. //
connectAttr -f place2dTexture1.rotateFrame file1.rotateFrame;
// Result: Connected place2dTexture1.rotateFrame to file1.rotateFrame. //
connectAttr -f place2dTexture1.mirrorU file1.mirrorU;
// Result: Connected place2dTexture1.mirrorU to file1.mirrorU. //
connectAttr -f place2dTexture1.mirrorV file1.mirrorV;
// Result: Connected place2dTexture1.mirrorV to file1.mirrorV. //
connectAttr -f place2dTexture1.stagger file1.stagger;
// Result: Connected place2dTexture1.stagger to file1.stagger. //
connectAttr -f place2dTexture1.wrapU file1.wrapU;
// Result: Connected place2dTexture1.wrapU to file1.wrapU. //
connectAttr -f place2dTexture1.wrapV file1.wrapV;
// Result: Connected place2dTexture1.wrapV to file1.wrapV. //
connectAttr -f place2dTexture1.repeatUV file1.repeatUV;
// Result: Connected place2dTexture1.repeatUV to file1.repeatUV. //
connectAttr -f place2dTexture1.offset file1.offset;
// Result: Connected place2dTexture1.offset to file1.offset. //
connectAttr -f place2dTexture1.rotateUV file1.rotateUV;
// Result: Connected place2dTexture1.rotateUV to file1.rotateUV. //
connectAttr -f place2dTexture1.noiseUV file1.noiseUV;
// Result: Connected place2dTexture1.noiseUV to file1.noiseUV. //
connectAttr -f place2dTexture1.vertexUvOne file1.vertexUvOne;
// Result: Connected place2dTexture1.vertexUvOne to file1.vertexUvOne. //
connectAttr -f place2dTexture1.vertexUvTwo file1.vertexUvTwo;
// Result: Connected place2dTexture1.vertexUvTwo to file1.vertexUvTwo. //
connectAttr -f place2dTexture1.vertexUvThree file1.vertexUvThree;
// Result: Connected place2dTexture1.vertexUvThree to file1.vertexUvThree. //
connectAttr -f place2dTexture1.vertexCameraOne file1.vertexCameraOne;
// Result: Connected place2dTexture1.vertexCameraOne to file1.vertexCameraOne. //
connectAttr place2dTexture1.outUV file1.uv;
// Result: Connected place2dTexture1.outUV to file1.uvCoord. //
connectAttr place2dTexture1.outUvFilterSize file1.uvFilterSize;
// Result: Connected place2dTexture1.outUvFilterSize to file1.uvFilterSize. //
defaultNavigation -force true -connectToExisting -source file1 -destination GLSLShader1.u_BaseColorTexture;
// Error: line 0: No object matches name: GLSLShader1.u_BaseColorTexture //

Using these files
damaged_helmet_albedo
damaged_helmet_emissive
damaged_helmet_metallic
damaged_helmet_normal
damaged_helmet_orm
damaged_helmet_roughness

Best
-Sk

@ziriax
Copy link
Contributor

ziriax commented Nov 24, 2020

Sorry, I meant the files in this GitHub repository, that you have to download or clone.

I haven't tried Maya 2019, only Maya 2018, I will try tomorrow.

BTW: when you assign the PBR shader, you need to multi-select all PBR textures in the file dialog box.

@Spkopach
Copy link
Author

Sounds Good,

During the assignment of the textures after clicking the Assign PBR. I tried multi-select and also single select. Both options failed and threw errors.

Thanks!
-Sk

@ziriax
Copy link
Contributor

ziriax commented Nov 25, 2020

I can't reproduce this. Can you make sure you have selected OpenGL as you rendering engine?

image

@Spkopach
Copy link
Author

Hey,

Yes that was the issue! Thank you. I was in OpenGL mode but Legacy version. After switching it to Compatibility it worked.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants