Is there a way to check where a command comes from?

I’m trying to check if a plugin created “BatchRenderNamedViews” command or if it was always there. Does Rhino have some way to check if a command is “native” to Rhino, if it’s an alias, created by plugin or otherwise?

What would you do with that information?

It would be useful to know if a command was created by a plugin, in this case vray, to decide whether to keep the plugin or unload it (vray significantly slows down rhino start up time).

Hi Daniel - you can check ‘in reverse’ - check all the commands provided by a plug-in and see if your command is in there.

-Pascal

1 Like

You can manually check in the plug-in manager. Clicking on a plug-in will show you what commands it provides. You can also write a bit of script to list the information in a format more convenient for you.

The command you mention is written by me and is in the core commands plug-in of Rhino.

1 Like

For a scripted version, you could call

and then for each plugin id, call

1 Like
import Rhino.PlugIns as rp

pl_cmd = dict()
for plkv in rp.PlugIn.GetInstalledPlugIns():
    guid = plkv.Key
    name = plkv.Value
    pl_info = rp.PlugIn.GetPlugInInfo(guid)
    pl_cmd[name] = [cmd for cmd in pl_info.CommandNames]

for pl in pl_cmd:
    print pl
    print "\t" + str(pl_cmd[pl])
1 Like

Thanks a lot, that’s really helpful. @nathanletwory I’ll try to add a simple filter to your script to have it show only plugins that match a selected command. @stevebaer thanks for the PlugIn.GetEnglishCommandNames Method - this will be very useful. @pascal I’ve run the ‘reverse search’ and seems like that command didn’t come from vray, which may explain why it wasn’t working

What isn’t working? As I mentioned earlier I wrote BatchRenderNamedViews and it is part of the Commands plug-in. It iterates over all named views and calls _Render for each. It should start rendering with the current selected render engine.

1 Like

oh sorry, I’ve missed that - that makes sense now, I’ve been using BatchRenderNamedViews with the “Current Renderer” set to “Vray for Rhino” and it gave these errors:
image
which I assume were due to the command calling Render too soon.

I’ve switched “Current Renderer” to “Rhino Render” and it… didn’t save the images at first (and didn’t close the “render windows”):

but I’ve tried again on another machine and it all worked fine, so hopefully it’ll sort itself out later on.

also thanks for the hint, I didn’t know that “Commands” were a plugin. It looks like lot of critical functionality in Rhino that I’ve been using is implemented as plugins, which is cool.

Lots of Rhino functionality is implemented through plug-ins. Raytraced/Rhino Render are both through plug-ins. This way we can ensure the infastructure and mechanisms actually work.

When you call _Render manually, do you get to use Rhino right after the VRay render has started? If so that is the problem. The _Render command is supposed to block, essentially.

Yes, you can. vrayRender isn’t blocking neither. That’s fine I guess though, because vray provides a batch renderer with their plugin (which didn’t work at first, required copying the entire model to another file, takes a lot more time than it should, because it closes the file when batch rendering and reopens it, which may require your input during this process if you have linked DWGs). Conveniently enough though it allows you to select named views from a graphical panel.

image