def runAsNimbleScript(self, **kwargs): """ Used to call the remote script as an independent operation outside of a MayaRouter, the normal method by which the script is executed. Used primarily for unit testing purposes and should not be called during normal operation. [kwargs]: Script arguments """ self.kwargs = kwargs if kwargs else nimble.getRemoteKwargs(globals()) self.response = nimble.createRemoteResponse(globals()) self.run()
import nimble from nimble import cmds kwargs = nimble.getRemoteKwargs(globals()) result = cmds.polySphere() name = result[0] offset = kwargs.get('offset', 10) cmds.move(offset, offset, offset, name) cmds.rotate(50, 20, 10, name) cmds.scale(2, 2, 2, name) response = nimble.createRemoteResponse(globals()) response.put('name', name) response.put('offset', offset)
from __future__ import print_function, absolute_import, unicode_literals, division import nimble from nimble import cmds kwargs = nimble.getRemoteKwargs(globals()) result = cmds.polySphere() name = result[0] offset = kwargs.get('offset', 10) cmds.move(offset, offset, offset, name) cmds.rotate(50, 20, 10, name) cmds.scale(2, 2, 2, name) response = nimble.createRemoteResponse(globals()) response.put('name', name) response.put('offset', offset)