Omni.kit.editor module not found

I’m using OV 2021.1 and trying to:

import omni.kit.editor

getting a mdoule not found error

Hi
This module is deprecated it is still I the product but should really not be used in most case as it not compatible with our latest apps SDK ui code

What are you trying to do ? Why did you want it in your scripts !

Thanks
Damien

@dfagnou, what was is replaced with, I can’t find any information online about this deprecation. How can we now use something like ‘subscribe_to_update_events’ and have updates made on each simulation step, for instance, updating the position of a robot.

Thanks.

Hello @kirsty.ellis! I pinged the development team about your question.

In the meantime, here is a link to our documentation which may help answer some of your questions!

Omni.kit.editor

@WendyGram, thank you for your response, I have seen the documentation for omni.kit.editor, however the problem is that I get an error when I attempt to import it, the same error as the user @david.burdick reports above ‘module not found’. I am also using version OV 2021.1. Thanks.

Hi everyone,

Editor was sort of monolithic legacy bundle, which is replaced with many small things. So depending on what you do you can use different extensions and API they provide.

To subscribe to update events you can use omni.kit.app:

# App/Subscribe to Update Events
import carb.events
import omni.kit.app


def on_update(e: carb.events.IEvent):
	print(f"Update: {e.payload['dt']}")


subscription_holder = (
	omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop(on_update, name="My Subscription Name")
)

You can find some snippets in “Script Editor” extension, but currently the best way to discover it would be opening whole “Create” folder in VSCode and looking and searching code of numerous extensions it contains in exts, kit/exts and kit/extscore subfolders.

1 Like

Thanks for the info. I am working with some code that was based on the navigation example here: Navigation Sample Applications — Omniverse Robotics documentation

A few things here seem to be deprecated. I am unable to find what I should replace the following with as it seems omni.kit.asyncapi no longer exists.

def _on_environment_setup(self):
    # wait for new stage before creating robot
    task = asyncio.ensure_future(omni.kit.asyncapi.new_stage())
    task1 = asyncio.ensure_future(self._create_robot(task))
    # set editor to play before setting up robot controller
    task2 = asyncio.ensure_future(self._play(task1))
    asyncio.ensure_future(self._on_setup_fn(task2))

Am I right in thinking that for set_camera_position and set_camera_target I should now use a viewport interface with omni.kit.viewport.get_viewport_interface()?

So I am using omni.kit.app now, as:
self._editor = omni.kit.app.get_app()
and I can check if it is running with:
self._editor.is_running() → this returns true, but I get errors like this:

2021-09-02 09:40:07 [43,882ms] [Warning] [omni.isaac.dynamic_control.plugin] DcFindArticulationDof: Function called while not simulating
2021-09-02 09:40:07 [43,882ms] [Error] [omni.isaac.dynamic_control.plugin] DcFindArticulationDof: Invalid or expired articulation handle

I saw in this thread Attempting to create custom Robot - #2 by toni.sm that with the old editor, there was a function called ‘play’, and if the simulation wasn’t playing, this error could be thrown. Does the ‘is_running’ function check the same thing as the previous ‘is_playing’ that used to be in omni.kit.editor?

Also I am running this in an extension.

Thanks

Apologies @kirsty.ellis we overlooked updating that page in the documentation with the api changes

I would recommend you look at the actual source file for that sample instead for now, we will fix the documentation issue for our next release:
/exts/omni.isaac.samples/omni/isaac/samples/scripts/navigation_preview.py

This error is caused when the dynamic control interface is used before simulation is running (play is called)

2021-09-02 09:40:07 [43,882ms] [Error] [omni.isaac.dynamic_control.plugin] DcFindArticulationDof: Invalid or expired articulation handle

you can use the timeline interface to play/stop the simulation:

self._timeline = omni.timeline.get_timeline_interface()
...
self._timeline.play()

There is also a forum specific to Isaac Sim that more of the isaac sim developers are on :)

1 Like