Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Scene context detection

Aperta
#1,467 0 commenti 1 reazione 3 assegnatari Vedi su GitHub

@Licini ci sta già lavorando.

Dal 29/5/2025.

  • #1499 di @copilot-swe-agent — aperta
  • #1500 di @copilot-swe-agent — chiusa senza merge

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug
def detect_current_context():
    """Chooses an appropriate context depending on available contexts and open instances. with the following priority:
    1. Viewer
    2. Plotter
    3. Rhino / GH - checked explicitly since SceneObjects for both get registered when code is run from either.
    4. Other

    Returns
    -------
    str
        Name of an available context, used as key in :attr:`SceneObject.ITEM_SCENEOBJECT`

    """

    if compas.is_grasshopper():
        return "Grasshopper"
    if compas.is_rhino():
        return "Rhino"
    if compas.is_blender():
        return "Blender"
    other_contexts = [v for v in ITEM_SCENEOBJECT.keys()]
    if other_contexts:
        return other_contexts[0]

    return None

The context detection code defaults to the first context found in ITEM_SCENEOBJECT when it is not detected to be one of Blender, Grasshopper, Rhino. Currently, on my system this is "Viewer", but the reason for this is random.

To Reproduce

scene = Scene()
meshobj = scene.add(mesh)

The type of meshobj will be the one registered for the viewer.

Expected behavior

The default context should be None, and the type of meshobj should be the base type.

Lingua principale
Python
Stelle
387
Fork
124
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di compas-dev/compas

Tutte le issue di compas-dev/compas

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.