Create Objects with python

Create Objects with python

How to create object with python

About Oil Objects (Object Introspection Library)

Oil is a library upon which Smode is based, that re-implements various C++ types so that their variables can be introspected. There are atomics (Integer, Boolean ...), smart pointers, containers and so on. Use this line below in the script to query all native objects.

For instance, Integer is one of them and you can write the line below to construct one with an initial value.
myInt = Oil.Integer(4)

Oil objects

In addition to regular Python and imported modules, all Oil objects can be instantiated.
Most types in Oil don't have a Python binding yet (and don't need one), but can still be constructed by passing their name to the Oil.createObject method. For instance
Oil.createObject("StrictlyPositiveInteger") #Integer with a minimal value of 1
which is an Oil type without a Python binding. The Oil.createObject() will be useful when creating object in the tree or Expose Python scripts parameters Configurable parameter for scripts Read More

See Also: