Hi, I'm very new to Nim (probably a couple of weeks only). Though I got interested on how to integrate to a software I use daily. So making use of nim + nimpy (and after some crashes to desktop) I was quite impressed that it worked.
A simple nim script -> pyd that runs maya.cmds module and creates a nurbs sphere. If this is possible, then I guess the options are many.
Not sure why, though it was required moving the import to inside the function to avoid crashing.
import nimpy
proc greet(name: string): string {.exportpy.} =
return "Hello, " & name & "!"
proc nimsph(): string {.exportpy.} =
let maya = pyImport("maya") #<- import only at execution time
return maya.cmds.sphere()[0].to(string)
Compiled in windows with w64devkit
-- If I figure out how to upload png I post an image of the result. Cheers!