nutti / fake-bpy-module

Fake Blender Python API module collection for the code completion.
MIT License
1.35k stars 96 forks source link

CollectionProperty don't have add(),clear(),move() ... mothed #108

Closed 1641585051 closed 2 years ago

1641585051 commented 2 years ago

IMG_20220807_174554 IMG_20220807_174616

 CollcetionProperty has many motheds ,such as add, clear ,move ...,this have similar motheds to list ,but blender api doc and your fake_module don't defined and declared  them, I don't know what the reason is ?  
 The evidence is in Collection Example ,URL is

"https://docs.blender.org/api/current/bpy.props.htmlhighlight=collectionproperty#bpy.props.CollectionProperty" 'add' method in the example is not found in doc and blender_module ,I found it through python reflection (dict(obj)..) The blender terminal can be passed through a method that the doc and fake_blender_module does not have. Can you please solve this problem?

nutti commented 2 years ago

@1641585051

Is there any documentations of the return type of bpy.props.CollectionProperty? We refer the documentation when we generate module.

1641585051 commented 2 years ago

@nutti blender doc has no relevant function description, possibly an oversight of theirs ,but add func does work out in blender's console. of course three are other functions I see. if the parameters and signatures of the function are not documented,there is readlly no way to fix the problem.

I'm just reporting this to you,whitch also relies on blender's official doc fix if it can't be solveld , it will not affect the development of the plugin, However,there will be no hint of this in VSCode

nutti commented 2 years ago

@1641585051

I think the document is generated from source/blender/python/intern/bpy_props.c#L3426-L3437.

This is a bit complicated situation because bpy.props.CollectionProperty adds a property to the RNA object not returning a value.

1641585051 commented 2 years ago

@nutti blender c and C plusplus source code I have not studied carefully,if you think you can solve it, then it will be great, beceuse when I see other developers writing code for properties, even if they write the type,they still don't have the hints for these functions

nutti commented 2 years ago

I think bpy.props.* does not return bpy.types.*Property because bpy.prop.* is also used for the annotation of the class (internally generates properties and functions, so on). So, it seems difficult to support this feature by changing the document.

1641585051 commented 2 years ago

well,thank you for your work in this regard

nutti commented 2 years ago

Due to the technical reason, close this issue. If there is a good method to solve this issue, please let me know.