pthom / imgui_bundle

Dear ImGui Bundle: an extensive set of Ready-to-use widgets and libraries, based on ImGui. Start your first app in 5 lines of code, or less. Whether you prefer Python or C++, this pack has your back!
https://pthom.github.io/imgui_bundle/
MIT License
590 stars 62 forks source link

When trying to draw the colorpicker4 function, an error occurred. #217

Closed iloveyehan closed 2 weeks ago

iloveyehan commented 3 weeks ago

Traceback (most recent call last): File "G:\work\001Blender\blender_init\addons\imguitest__init__.py", line 146, in draw cb(bpy.context) # 尝试调用回调函数 ^^^^^^^^^^^^^^^ File "G:\work\001Blender\blender_init\addons\imguitest__init__.py", line 277, in draw_call changed1, self.color=imgui.color_picker4("MyColor", self.color4, misc_flags ) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: color_picker4(): incompatible function arguments. The following argument types are supported:

  1. (label: str, col: Annotated[List[float], FixedSize(4)], flags: int = 0, ref_col: float = None) -> Tuple[bool, Annotated[List[float], FixedSize(4)]]

Invoked with: 'MyColor', [1.0, 0.5, 0.0, 0.5], 131072
Can you provide a usable data type?

pthom commented 3 weeks ago

Hi,

the API for color_picker4 was revised to:

def color_picker4(
    label: str, col: ImVec4, flags: ColorEditFlags = 0, ref_col: Optional[ImVec4] = None
) -> Tuple[bool, ImVec4]:
    pass

But to use it, you need to install the latest version: either compile from source, or try on of the recent wheels built in the CI

iloveyehan commented 3 weeks ago

thank u