fake-bpy-module icon indicating copy to clipboard operation
fake-bpy-module copied to clipboard

Missing Cycles Package

Open lembn opened this issue 2 years ago • 4 comments

I recently discovered that Cycles types are generated at runtime, so aren't available for static typing. As such information about the cycles package is missing from the documentation also. For example, the following import is not recognised by the IDE but executes successfully in Blender's Python environment.:

from cycles.properties import CyclesPreferences, CyclesRenderSettings

Since the entire cycles module is undocumented, I found these types using dir() on the module and its sub-packages in Blender's interactive Python environment until I got to what I needed.

I am willing to contribute more to the addition of this feature but would like some guidance on how to start since this package can't be generated from codebase analysis as it only exists at runtime.

lembn avatar May 24 '22 10:05 lembn

@lembn

Sorry for late reply.

fake-bpy-module parses the Python API document and output fake module. So, we need to add manually the module like this if you include undocumented Python API.

nutti avatar Jun 13 '22 06:06 nutti

@lembn

Is there any update about this issue? If you are still trying this issue, I will support.

nutti avatar Jul 18 '22 09:07 nutti

Sorry for my inactivity recently. I've been quite busy so haven't got round to checking out the solution but will get onto it soon.

lembn avatar Jul 18 '22 12:07 lembn

@lembn

Thanks. I will wait for your contribution.

nutti avatar Aug 05 '22 09:08 nutti

I think latest Blender does not create documents of bpy.types.CyclesRenderSettings. So, it seems this feature seems invalid for the latest Blender. What do you think?

nutti avatar Aug 26 '22 12:08 nutti

I found that cycle package can be found at 3.2/scripts/addons/cycles. (Sorry for forgetting that cycle package is just an add-on)

You can add this path to your auto completion system. I think this workaround will realize the thing you want. In my environment, this works fine and autocomplete the code in cycle modules.

We also do not want add the code to generate the fake module, because cycle is the addon. Please try the above workaround instead.

nutti avatar Aug 26 '22 13:08 nutti

Nice catch! Thanks for sorting that out.

Sorry for my unresponsiveness. I kept getting carried away with work and never had time to look into the solution but I really appreciate your diligent research and will use the addon package in the future.

Thanks

lembn avatar Sep 09 '22 16:09 lembn