Skip to content

The correct way to use 'set_view_order' ? #16

Open

Description

@cache-tlb

Hi, I'm using the interface set_view_order as follows:

view_order = np.array([ 3, 1, 2, 0 ], dtype=np.uint16)
bgfx.set_view_order(0, 4, as_void_ptr(view_order))

and get a trace:

TypeError: set_view_order(): incompatible function arguments. The following argument types are supported:
    1. () -> None
    2. (_id: int) -> None
    3. (_id: int, _num: int) -> None
    4. (_id: int, _num: int, _remap: int) -> None

Invoked with: 0, 4, <capsule object NULL at 0x1ec75f090>

It seems that I should pass an int for the last parameter. But how could an int represent the remap table?

I also notice other interfaces like set_view_transform declare the parameter for an array as const void*. However in the case of set_view_interface, that parameter is declared as const unsigned short *. See bgfx_python.cpp, line 1339. May it be a bug here?

Thanks for your help!

Activity

  1. fbertola commented on Oct 16, 2020

    @fbertola
    Owner

    Hi @cache-tlb! Yes it's a bug, the mapping were generated automatically and sometimes it failed to interpret those types successfully. I've already implemented a fix for ImGUI with uses the same patterns and I will extend it also to these interfaces. Thanks for pointing it out!

  2. fbertola commented on Nov 1, 2020

    @fbertola
    Owner

    @cache-tlb I fixed the issue in the types_marshalling brach. If you're able to build it from source, that would be the fastest way to use it, as I would like to overhaul the types conversion first. Let me know if you need any help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions