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

hou - improve render callbacks typing #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Andrej730
Copy link

@Andrej730
Copy link
Author

@chadrik hi! can you please take a look?

@chadrik
Copy link
Collaborator

chadrik commented Aug 30, 2024

@isohedronpipeline Can you weigh in on this please!

@chadrik
Copy link
Collaborator

chadrik commented Aug 30, 2024

I think my main concern here is that the goal of this repo is to define a process to generate stubs, rather than manually editing stubs, which makes it easier for us to generate stubs when new versions come out (Note: Most of the stubs in the repo have been moved to use a single stubgenlib helper module, but Houdini is still using a different system).

Would you mind having a look to see if you can adapt the Houdini generator rather than editing the stubs directly:

https://github.com/LumaPictures/cg-stubs/blob/master/houdini/extras/hou_pyi_update.py

@Andrej730
Copy link
Author

Andrej730 commented Aug 30, 2024

@chadrik I don't think it's documented in either hou.py or _hou.pyd in a parsable way, it's just documented in a doc-string text.

image

@chadrik
Copy link
Collaborator

chadrik commented Sep 2, 2024

I'm not an expert in the Houdini stub generator that @isohedronpipeline wrote, but it looks like you can add an entry to MISSING_FUNCTION_DEFINITIONS to override annotations.

@isohedronpipeline
Copy link

I was thinking it would be nice to convert the types in hou.py to python types to avoid that awful thing I put together, but you can see here:
def addRenderEventCallback(self, callback: "InterpreterObject", run_before_script: "bool"=False) -> "void":

Doesn't look like that would cut it entirely, since InterpreterObject is meaningless for this purpose.

Given that, the best way forward would be to add it to the MISSING_FUNCTION_DEFINITIONS dictionary to override what the script comes up with.

@Andrej730
Copy link
Author

Andrej730 commented Sep 2, 2024

Is there some instructions how to regenerate stubs to see that changes worked?

I'm on windows and noticed a few issues:

  1. hou_pyi_update.py is looking for bootstrap_luma, setpkglib, pylib not sure where to get it
  2. stubgen_houdini.sh is looking for setpkg command. I was able to find https://github.com/LumaPictures/setpkg but it seems to be outdated and made for Python 2.

@Andrej730
Copy link
Author

@chadrik @isohedronpipeline any advice on where I can get the dependencies for stubs regeneration?

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

Successfully merging this pull request may close these issues.

3 participants