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

Houdini: OpenGL Review support LOPs/Solaris source mode #4890

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Apr 21, 2023

Changelog Description

Allow reviews using the openGL node to use LOP Paths.

Additional info

Based on comment here that OpenGL review node publishing didn't support Solaris reviews yet using LOP paths.

TODO:

  • Update creator to allow 'use selection' for LOP paths and then have it auto-set to LOPs source mode.
  • Update collector to collect focal lengths for LOPs camera
    • Make sure it always collects the correct data (see todo in code)
  • Update validator to allow LOPs scene path, etc.
  • Test

Testing notes:

  1. Set up openGL review instance to use LOP path
  2. Publish review
  3. Set up openGL review instance to use OBJ camera path
  4. Publish review

Make sure to publish with reviews enabled so it also tests the focal length burnin.

…views

- However, note the todo. That's a massive implementation issue likely?
@BigRoy BigRoy added type: enhancement Enhancements to existing functionality host: Houdini community contribution labels Apr 21, 2023
@ynbot ynbot added the size/S Denotes a PR changes 100-499 lines, ignoring general files label Apr 21, 2023
@moonyuet
Copy link
Member

moonyuet commented Apr 25, 2023

Guess the first TODO is finished if the LOP path is included as the force object. But if you are talking about camera inside LOP network, pretty sure it still needs some work.
image
(will investigate the collect review to see if it collects the LOP's camera)

@moonyuet
Copy link
Member

checked the collector, it seems that it doesn't collect the correct focal length from camera in LOP networks
image

@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 25, 2023

@moonyuet You will at least need to set it to LOPs source mode at the top. Without that you can't extract openGL with LOPs content.

houdini_review_lops_source

@moonyuet
Copy link
Member

moonyuet commented Apr 25, 2023

@moonyuet You will at least need to set it to LOPs source mode at the top. Without that you can't extract openGL with LOPs content.

houdini_review_lops_source

Thank you, the collector works to collect the focal length.
image

@moonyuet
Copy link
Member

@BigRoy I have updated the code for validating LOP networks and both add LOP networks and cameras into the opengl if the use selection enabled.
I also add an options for user to enable "LOP as source"(not sure if it is a good name). If they want to use LOP networks for review, they can enable it in the creator.
image

@BigRoy
Copy link
Collaborator Author

BigRoy commented Jun 21, 2023

I also add an options for user to enable "LOP as source"(not sure if it is a good name). If they want to use LOP networks for review, they can enable it in the creator.

Can't we match what Houdini does with a "Source" enum attribute that is either "LOPs" or "SOPs"? Just so it's also familiar to those working with the OpenGL rop node?

@@ -56,30 +57,48 @@ def create(self, subset_name, instance_data, pre_create_data):
"aspect": pre_create_data.get("aspect"),
})

lop_enabled = pre_create_data.get("lopEnabled")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just stick close to what Houdini uses internally and define a opSource or source type of data which defines either "SOPs" or "LOPs". That would also leave the path open to potential other sources that might ever appear in the future in Houdini? Plus it's also clearer that when LOPs is not chosen that it uses SOPs.

Comment on lines 61 to 63
lop_node = hou.node(node_name)
if lop_node.type().name() != "lopnet":
return [node_name]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an invalid requirement. The LOP Network parameter can be set to any LOP node inside the LOP network and is not necessarily the LOP network itself. Right?

Comment on lines 65 to 76
def get_invalid_resolution(self, instance):
node = hou.node(instance.data.get("instance_node"))

# The resolution setting is only used when Override Camera Resolution
# is enabled. So we skip validation if it is disabled.
override = rop_node.parm("tres").eval()
override = node.parm("tres").eval()
if not override:
return

invalid = []
res_width = rop_node.parm("res1").eval()
res_height = rop_node.parm("res2").eval()
res_width = node.parm("res1").eval()
res_height = node.parm("res2").eval()
Copy link
Collaborator Author

@BigRoy BigRoy Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this was changed, but the old logic made more sense where it took the rop_node directly. Especially because the instance ROP node already seems to be retrieved in process

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe thid is the issue coming from merging develop to the branch. i agree that rop_node is more concise than node

@MustafaJafar
Copy link
Contributor

MustafaJafar commented Jul 20, 2023

I tested it by modifying rop node manually and it successfully published with no errors
image

I have an idea to update the creator, I'm going to try it.
pseudocode something like this

In LOPs Context

  case 1: No Selection 
    will only set `source` to `LOPs`
  
  case 2: one node selected 
    use its path as `loppath`
    if camera: 
      use its primpath as `cameraprim`
  
  case 3: two or more are selected 
    use camera's primpath as `cameraprim`
    pop camera from selection
    use first node as `loppath`

Do you think it would be a good thing to differentiate between LOPs cameras and OBJs camera by something like this in the collector:

if obj_camera:
    instance.data["families"].append("review.obj")
else:
    instance.data["families"].append("review.lop")

this idea was inspired that houdini pointcache issue

I think this will be a good idea so that each can have proper validators with clear objective.

@MustafaJafar
Copy link
Contributor

MustafaJafar commented Jul 20, 2023

I gave it a shot.
I believe we will need at first to filter selected_nodes to sperate hou.ObjNode(s) from hou.LopNode(s)
because user can accidently have multiple selection from different contexts which can be confusing.

I may made that filtration in a different way.

Imagine lop camera was the first node in selection, a user will complaint about selecting the obj camera but a lop camera was set!

in the attached code, for this particular case the camera will be empty instead.
image

I can try again later.

Here you are what I have achieved (with a lot of overthinking)
create_review.zip

image

@moonyuet
Copy link
Member

I gave it a shot. I believe we will need at first to filter selected_nodes to sperate hou.ObjNode(s) from hou.LopNode(s) because user can accidently have multiple selection from different contexts which can be confusing.

I may made that filtration in a different way.

Imagine lop camera was the first node in selection, a user will complaint about selecting the obj camera but a lop camera was set!

in the attached code, for this particular case the camera will be empty instead.
image

I can try again later.

Here you are what I have achieved (with a lot of overthinking) create_review.zip

image

I agree with you that we can append different families for the validation of different networks.
But I think it's a bit overthinking for the creator.
We can make some validators to make sure the nodes are LOP nodes if source type are set to LOP network, while validating the nodes are OBJ nodes if Objects are set as source type.
We need to probably validate the LOP Nodes such as Primitive or Reference node to make sure the primitive path are correct.

@mkolar
Copy link
Member

mkolar commented Feb 6, 2024

Because we're splitting OpenPype into ayon-core and individual host addons, this PR would have to be re-created to target one of those.

We're closing it down, but we'll he happy for a new PR to ynput/ayon-houdini repository once it's up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contribution host: Houdini host: UE size/S Denotes a PR changes 100-499 lines, ignoring general files type: enhancement Enhancements to existing functionality
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Enhancement: Houdini: Unable to review/Render using Lopimportcamera
7 participants