This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Looks: add basic support for Renderman #3190
Merged
antirotor
merged 6 commits into
develop
from
enhancement/OP-3256_support-for-pxrtexture
May 25, 2022
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3484d57
add support for PxrTexture
antirotor 694c365
list to sets and var name change
antirotor 43f7ad5
support for other renderman nodes
antirotor 5ceba8c
fix supported nodes
antirotor 4c4c824
:recycle: refactored work with attributes
antirotor 93c4e34
:bug: fix node attribute name
antirotor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -77,9 +77,14 @@ def node_uses_image_sequence(node): | |||||
node_path = get_file_node_path(node).lower() | ||||||
|
||||||
# The following tokens imply a sequence | ||||||
patterns = ["<udim>", "<tile>", "<uvtile>", "u<u>_v<v>", "<frame0"] | ||||||
|
||||||
return (cmds.getAttr('%s.useFrameExtension' % node) or | ||||||
patterns = ["<udim>", "<tile>", "<uvtile>", | ||||||
"u<u>_v<v>", "<frame0", "<f4>"] | ||||||
try: | ||||||
extension = cmds.getAttr('%s.useFrameExtension' % node) | ||||||
except ValueError: | ||||||
extension = None | ||||||
|
||||||
return (extension or | ||||||
any(pattern in node_path for pattern in patterns)) | ||||||
|
||||||
|
||||||
|
@@ -165,7 +170,7 @@ def get_file_node_path(node): | |||||
if any(pattern in lower for pattern in patterns): | ||||||
return texture_pattern | ||||||
|
||||||
if cmds.nodeType(node) == 'aiImage': | ||||||
if cmds.nodeType(node) in ['aiImage', 'PxrTexture']: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would lookup in
Suggested change
|
||||||
return cmds.getAttr('{0}.filename'.format(node)) | ||||||
if cmds.nodeType(node) == 'RedshiftNormalMap': | ||||||
return cmds.getAttr('{}.tex0'.format(node)) | ||||||
|
@@ -326,7 +331,10 @@ def collect(self, instance): | |||||
"volumeShader", | ||||||
"displacementShader", | ||||||
"aiSurfaceShader", | ||||||
"aiVolumeShader"] | ||||||
"aiVolumeShader", | ||||||
"rman__surface", | ||||||
"rman__displacement" | ||||||
] | ||||||
if look_sets: | ||||||
materials = [] | ||||||
|
||||||
|
@@ -376,6 +384,7 @@ def collect(self, instance): | |||||
|
||||||
files = cmds.ls(history, type="file", long=True) | ||||||
files.extend(cmds.ls(history, type="aiImage", long=True)) | ||||||
files.extend(cmds.ls(history, type="PxrTexture", long=True)) | ||||||
files.extend(cmds.ls(history, type="RedshiftNormalMap", long=True)) | ||||||
|
||||||
self.log.info("Collected file nodes:\n{}".format(files)) | ||||||
|
@@ -510,23 +519,21 @@ def collect_resource(self, node): | |||||
Returns: | ||||||
dict | ||||||
""" | ||||||
|
||||||
self.log.debug("processing: {}".format(node)) | ||||||
if cmds.nodeType(node) not in ["file", "aiImage", "RedshiftNormalMap"]: | ||||||
if cmds.nodeType(node) not in [ | ||||||
"file", "aiImage", "RedshiftNormalMap", "PxrTexture"]: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, lookup in |
||||||
self.log.error( | ||||||
"Unsupported file node: {}".format(cmds.nodeType(node))) | ||||||
raise AssertionError("Unsupported file node") | ||||||
|
||||||
self.log.debug(" - got {}".format(cmds.nodeType(node))) | ||||||
if cmds.nodeType(node) == 'file': | ||||||
self.log.debug(" - file node") | ||||||
attribute = "{}.fileTextureName".format(node) | ||||||
computed_attribute = "{}.computedFileTextureNamePattern".format(node) | ||||||
elif cmds.nodeType(node) == 'aiImage': | ||||||
self.log.debug("aiImage node") | ||||||
elif cmds.nodeType(node) in ['aiImage', 'PxrTexture']: | ||||||
attribute = "{}.filename".format(node) | ||||||
computed_attribute = attribute | ||||||
elif cmds.nodeType(node) == 'RedshiftNormalMap': | ||||||
self.log.debug("RedshiftNormalMap node") | ||||||
attribute = "{}.tex0".format(node) | ||||||
computed_attribute = attribute | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
extension = False
to still return a boolean.Also, might be better as a variable named
use_frame_extension
?