-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6473: Some ground work to load script algorithms from builtin/*.py. …
…Add ScriptingSystemInterface skeleton. Refactoring.
- Loading branch information
1 parent
dacbe45
commit 9ac6de8
Showing
10 changed files
with
113 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import dr as darkradiant | ||
|
||
class ResizeSelectedBrushesToBounds: | ||
def execute(self, min: dr.Vector3, max: dr.Vector3, material: str): | ||
print(min) | ||
print(max) | ||
print(material) | ||
|
||
import inspect | ||
for name, obj in inspect.getmembers(sys.modules[__name__], inspect.isclass): | ||
print(name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "ScriptingSystemInterface.h" | ||
|
||
namespace script | ||
{ | ||
|
||
void ScriptingSystemInterface::registerBuiltinScriptCommand() | ||
{ | ||
|
||
} | ||
|
||
void ScriptingSystemInterface::registerInterface(py::module& scope, py::dict& globals) | ||
{ | ||
// Add the ScriptingSystemInterface module declaration to the given python namespace | ||
py::class_<ScriptingSystemInterface> interface(scope, "ScriptingSystemInterface"); | ||
|
||
interface.def("registerBuiltinScriptCommand", &ScriptingSystemInterface::registerBuiltinScriptCommand); | ||
|
||
// Now point the Python variable "GlobalScriptingSystem" to this instance | ||
globals["GlobalScriptingSystem"] = this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include "iscriptinterface.h" | ||
|
||
namespace script | ||
{ | ||
|
||
class ScriptingSystem; | ||
|
||
/** | ||
* Exposes the GlobalScriptingSystem interface to scripts | ||
*/ | ||
class ScriptingSystemInterface : | ||
public IScriptInterface | ||
{ | ||
private: | ||
ScriptingSystem& _scriptingSystem; | ||
|
||
public: | ||
ScriptingSystemInterface(ScriptingSystem& scriptingSystem) : | ||
_scriptingSystem(scriptingSystem) | ||
{} | ||
|
||
void registerBuiltinScriptCommand(); | ||
|
||
// IScriptInterface implementation | ||
void registerInterface(py::module& scope, py::dict& globals) override; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters