Skip to content

Commit

Permalink
Finalize on 1.38.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb committed Sep 9, 2023
1 parent fcf1e8a commit 3a9d38e
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 2 deletions.
17 changes: 17 additions & 0 deletions source/MaterialXglTF/GltfMaterialHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright 2022 - 2023 Bernard Kwok
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <MaterialXCore/Value.h>
#include <MaterialXCore/Types.h>
Expand Down
27 changes: 26 additions & 1 deletion source/MaterialXglTF/GltfMaterialHandler.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright 2022 - 2023 Bernard Kwok
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef MATERIALX_CGLTF_MaterialHandler_H
#define MATERIALX_CGLTF_MaterialHandler_H
Expand Down Expand Up @@ -49,7 +66,12 @@ class MX_GLTF_API MaterialHandler
/// to perform actions such as shader translation and baking.
/// </summary>
/// <param name="doc">Document to modify</param>
virtual void translateShaders(DocumentPtr /*doc*/, StringVec& /*log*/) {};
/// <param name="log">Error log</param>
virtual void translateShaders(DocumentPtr doc, StringVec& log)
{
std::ignore = doc;
std::ignore = log;
};

/// <summary>
/// Set document containing MaterialX definitions. This includes core library
Expand Down Expand Up @@ -153,13 +175,15 @@ class MX_GLTF_API GltfMaterialHandler : public MaterialHandler
/// Convert MaterialX document to glTF and save to file path
/// </summary>
/// <param name="filePath">File path</param>
/// <param name="log">Error log</param>
/// <returns>True on success</returns>
bool load(const FilePath& filePath, StringVec& log) override;

/// <summary>
/// Convert glTF to MaterialX document and save to file path
/// </summary>
/// <param name="filePath">File path</param>
/// <param name="log">Error log</param>
/// <returns>True on success</returns>
bool save(const FilePath& filePath, StringVec& log) override;

Expand All @@ -169,6 +193,7 @@ class MX_GLTF_API GltfMaterialHandler : public MaterialHandler
/// to perform actions such as shader translation and baking.
/// </summary>
/// <param name="doc">Document to modify</param>
/// <param name="log">Error log</param>
void translateShaders(DocumentPtr doc, StringVec& log) override;

private:
Expand Down
17 changes: 17 additions & 0 deletions source/MaterialXglTF/GltfMaterialUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright 2022 - 2023 Bernard Kwok
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <MaterialXglTF/GltfMaterialUtill.h>

Expand Down
17 changes: 17 additions & 0 deletions source/MaterialXglTF/GltfMaterialUtill.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright 2022 - 2023 Bernard Kwok
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef MATERIALX_GLTF_UTIL_H
#define MATERIALX_GLTF_UTIL_H

Expand Down
13 changes: 13 additions & 0 deletions source/MaterialXglTF/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2022 - 2023 Bernard Kwok

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http ://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
7 changes: 7 additions & 0 deletions source/glTF2Mtx/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2022-2023 Bernard Kwok

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 17 additions & 0 deletions source/glTF2Mtx/glTF2Mtlx.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright 2022 - 2023 Bernard Kwok
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <MaterialXCore/Document.h>
#include <MaterialXCore/Util.h>
#include <MaterialXFormat/XmlIo.h>
Expand Down
7 changes: 7 additions & 0 deletions source/glTFMtlxTest/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2022-2023 Bernard Kwok

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 17 additions & 0 deletions source/glTFMtlxTest/MaterialXglTF/MaterialXglTF.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
Copyright 2022 - 2023 Bernard Kwok
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http ://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#include <glTFMtlxTest/Catch/catch.hpp>

Expand Down

0 comments on commit 3a9d38e

Please sign in to comment.