Giter Site home page Giter Site logo

Comments (6)

fangchangma avatar fangchangma commented on July 17, 2024 3

It would be great to add a minimal working example of how to create a scene directly in Python (rather than loading an XML file).

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024 2

The current release doesn't implement python bindings for the PluginManager class. This is likely to come in a future release.

In the meantime, the only way to create a scene is generate an XML file and load it.

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

@Speierers I took a stab at it. I am able to create a scene in python with classes that are constructible in python(SamplingIntegrator, Sensor, Emitter) and render a scene. However, I am the not able to create a scene which all the supported xml tags.
The problem has been that I need access to base class ptr to call PluginManager::create_object. For ex: to create HDRFilm I need access to Film::m_class. On digging deeper in xml.cpp, I found that it has a variable tag_class which stores all the base class pointers.
Can you guide me on how to access base class ptr to make a call to PluginManager::create_object for all the tags supported in Mitsuba?

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

Hi @arpit15,
Thanks for looking into this!
At this point it would be easier to open a PR so I could have a look a your code to guide you further.

from mitsuba2.

arpit15 avatar arpit15 commented on July 17, 2024

I have created a PR here.
There is a lot of unnecessary code on python side. A better way would be to have a dictionary like tag_class in xml.cpp and use the property like node_name to pass in a lambda function in plugin_v.cpp. However, I can't seem to figure out how to get access to class ptr as done in xml.cpp

from mitsuba2.

Speierers avatar Speierers commented on July 17, 2024

Thanks @arpit15. I am closing this as further discussions should take place in the PR from now.

from mitsuba2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.