-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssetObject class to add or remove SceneObjects from Scene #536
base: main
Are you sure you want to change the base?
Conversation
…ject in a scene through scene .xml file manipulation.
… Added the support of multi-shape assets.
move them, interaction with component objects and RT. Start material cells. Fix all .xml files from Sionna.
…s. Some fix are still necessary to pass all tests.
…ssetObject or a SceneObject is kept during scene reload. Reorganisation of all the asset related tests.
…ifying the radio_material of an asset or a scene object.
…cene class (using scene.get() or scene.objects), such that SceneObjects can be garbage collected when deleted from within the Scene class.
…Scene and RadioMaterial class documentations accordingly.
Signed-off-by: Guillaume Larue <[email protected]> Signed-off-by: Louis-Adrien Dufrène <[email protected]>
Hi @guillaume-larue, |
This will be very important funtionality! What about the merge? |
Hello Sionnateams and Mr @guillaume-larue thank for your effort Sorry but if you create a shape like this in mitsuba it works but: import mitsuba as mi
# Inizializza Mitsuba con il plugin corretto
mi.set_variant('scalar_rgb')
# Definizione di un cubo come shape Mitsuba
mi_shape = mi.load_dict({
"type": "cube", # Tipo di forma Mitsuba
"to_world": mi.ScalarTransform4f.translate([0, 0, 0]) @ mi.ScalarTransform4f.scale([5, 2, 1.5]) # Set Dimension
})
car = sionna.rt.SceneObject(name="Car01",
object_id='car01',
mi_shape = mi_shape
)
scene.add(car) it seems that the creation of the object was blocked in v 0.19 by a control. is it possible to just have at first just a basic type of element like a box (usefull for car, truck or why not human): myBox1 = Scene.Box(name,position,orientation,scale,material,color)
scene.add(myBox1) Step 2 - Load ObjectWhy not have function like LoadObject(file=XMLFile) for a type sionna.rt.SceneObject and the you can add at a scene any object exported in mitsuba file. |
- Update the default (random) rgb property of a BSDF based on default (itu) material bsdf rgb from XML file (when it is only defined as a rgb tuple). - Update the rgb property of the BSDF when the BSDF is constructed based on a simple XML element containing only a rgb tuple.
…list, when items list contains AssetObject already present in the scene (i.e. which trigger a scene.remove() call). Signed-off-by: guillaume-larue <[email protected]>
Thank you for your comments and suggestions, @Fedomer! Regarding adding objects directly with SceneObject(mi_shape), this wouldn't, to my understanding, update important elements like path and coverage map solvers, which could lead to inaccurate radio simulations (can you confirm, @SebastianCa?). That's why we defined the scene.reload() method, which is typically used when adding AssetObjects. Your suggestion about loading objects from XML files is in a sense similar to how AssetObjects work:
Yet, the AssetObject approach allows for simple manipulations, particularly for complex objects composed of multiple shapes. For example, rotating around a common center is much easier with AssetObjects than with independent SceneObjects (which would be the case when importing an XML file containing multiple shapes). @SebastianCa @jhoydis - Congratulations on the new Sionna v0.19 release! Do you have any updates on this PR? I have added a few small commits to fix some minor bugs. @Inv4lidn4m3 and I are available to discuss or clarify anything if needed. 😃 |
Hi @guillaume-larue, Thanks again for this PR. We are currently implementing some very significant changes in the Sionna RT module and cannot merge your PR for now. |
Hi @jhoydis, Thank you for the update on the PR status. I understand that significant changes are currently being implemented in the Sionna RT module, which prevents merging at this time. For your information, we've had the opportunity to present these features to partners in a European project. It raised substantial interest. We thought this might be useful context as you plan future developments. I'm available to discuss or update the PR whenever it aligns with your development timeline. |
Hi @guillaume-larue, That's great to hear. Please be patient :-) |
Description
Related to discussion 512
The present pull request enables the addition and removal of (group of) SceneObjects in the current scene. These objects, named assets, are handled by a dedicated new class,
AssetObject
. They are described in the same way a scene is described, i.e., from a Blender Mitsuba Export .xml file and a set of .ply meshes. Hence, new asset objects can be created using Blender.The addition and removal of assets are straightforward.
AssetObject
basically offers the same API properties asSceneObject
, including position, orientation, velocity, and radio_materials. Assets can interact with ray tracing, as they are basically composed ofSceneObjects
, hence relying on legacy features of Sionna.The pull request also proposes an improved way to manage the rendering of
RadioMaterial
. Thanks to theBSDF
class, it is now possible to easily manipulate and update the way aRadioMaterial
of the scene is rendered.A novel Jupyter Notebook named
Sionna_Ray_Tracing_Asset.ipynb
is added to explain in detail how to use these features, and the documentation of the asset-related classes has been updated.New APIs for the added
AssetObjects
functionalities have been provided. No changes in legacy APIs, except forSceneObjects
referenced outside theScene
class, which are now weak-referenced to avoid remaining strong references to removedSceneObjects
(when accessingscene.objects
property or callingscene.get("scene_object_name")
).We have noticed the demands for signed-off commits only when preparing the Pull Request. Since the change in the git history would be quite significant, is this absolutely mandatory to do it on all the commits, or would a single signed-off commit be sufficient for the complete pull request (as provided here)?
Co-authored-by: [email protected]
Checklist
Co-authored-by: user@domain
and ensure they signed off their commits too.