Scene context detection
@Licini ci sta già lavorando.
Dal 29/5/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di compas-dev/compas
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
compas-dev/compas#1523 · 3 commenti ·
-
Numpy and Rhino 9Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
compas-dev/compas#1507 · 2 commenti · 1 reazione ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
compas-dev/compas#1504 · 1 commento ·
-
More transformations of shapesForse già presa @copilot-swe-agent l’ha presa 364 giorni fa. Aperta
compas-dev/compas#1493 · 1 reazione · 1 assegnatario ·
-
`Polygon.normal` with `normal_polygon` instead of `normal_triangle`?Forse già presa @copilot-swe-agent l’ha presa 350 giorni fa. Aperta
compas-dev/compas#1487 · 1 reazione · 1 assegnatario ·
Tutte le issue di compas-dev/compas
Issue simili
-
customer-reported question
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Azure/azure-sdk-for-python#49548 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
btclib-org/btclib-wallet#409 ·
I maintainer di solito rispondono entro 1 giorno
-
Phase 2 PSA Capability & Career Profile
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bcgov/digital-journeys#2310 ·
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fastmachinelearning/hls4ml#1582 ·
I maintainer di solito rispondono entro 3 giorni
-
Sort modelsApertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno