Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ozone · Mar 09, 2014 at 11:35 PM · pythonmodules

Is it possible to use the Open Babel Python module in Unity?

I am designing a game in which I would like to simulate chemical reactions using the SMILES notation interpreter Open Babel, which comes as a Python module. I have heard of people getting various versions of Python to work for scripting in Unity, but I am wondering if anyone thinks it would be possible to use a module like Open Babel in Unity scripts. The Open Babel Python module is described in detail here.

If anyone has an idea as to how this could work or has heard of anyone doing anything similar, please let me know!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benproductions1 · Sep 15, 2014 at 12:02 AM 0
Share

Just a quick note, you should be warned that python is not fast. The only way to run python in .NET (AFAI$$anonymous$$) is using Python for .NET, which is a reimplementation of CPython (The standard python interpreter) for .NET. The CPython interpreter has a significant overhead and may be deadly for performance critical applications. If you need it to be fast, you should look for an equivalent library in a compiled .NET compatible language. If not, then you won't have to worry.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Adversary · Sep 14, 2014 at 10:14 PM

It's almost certainly possible, but it will require a significant amount of fiddling (which is why I haven't bothered just to prove the point). Note that the Python module for this thing still calls a library installed with the OpenBabel GUI, so it's not entirely self-contained (which adds more fiddling with the install).

To answer your question explicitly: if you can get that module to work with the natively installed version of CPython (2.7.x) on your system, then connecting that to Mono/Unity through Python for .NET will probably get you where you want.

That said, the OpenBabel site includes libraries for .NET directly and that might be a better route given Unity is built on Mono and .NET. If you're on Windows then this should definitely be considered and even if you're not then it should still be considered. Doing it in Python is going to involve spending a decent amount of time on the command line. There is no way around that (yet).

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benproductions1 · Sep 15, 2014 at 12:07 AM 0
Share

Open Babel is self contained. Only the optional GUI application (which is obviously not wanted) requires wxWidgets. Otherwise it doesn't have any requirements and is self contained.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to import the object from server to unity 2 Answers

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Material doesn't have a color property '_Color' 4 Answers

Setting Scroll View Width GUILayout 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges