-
Posts
7,668 -
Joined
-
Last visited
Content Type
Forums
Calendar
Gallery
Everything posted by Andrew Shpagin
-
This is (I hope) is what you need: # This example demonstrates the power of the dialogs and UI. It describes how to register the elements into the UI. import coat # let's define the class. Then we create the ui function that exposes the ui elements list class MyClass : def __init__(self) : self.Integer = 0 self.stage = 0 def process(self) : self.stage += 1 # we use comparison to 5 to give some time to dialog to appear and to avoid constant clicking if self.stage == 5 : coat.ui.cmd("$BaseClass::Integer") # this section used for the class serialization and visual presentation in the UI def ui(self) : # since ui called constantly, we may do some actions there, for example click over controls self.process() # there you define the list of variables and functions to show in the dialog. # This list is dynamic, this function is constantly called, any changes in list # will be exposed immediately return [ "Integer" # we write there the name of variable we want to expose to the UI ] p = MyClass() # show the dialog coat.dialog().ok().cancel().params(p).caption("Hello!").show(); There is sort of workaround, in 38 there will be more logical solution, you will be able to pass process callback into the dialog.
-
Unwrap Bug?
Andrew Shpagin replied to alvordr's topic in New Releases, Bugs Reports & Development Discussion
Select the island, SPACE, To Stripe, Auto-scale -
The source of problems is that script ends and class CmdPanel does not exist anymore after the end of the script. The correct script is below. The key is the registering the proxy tool that forces the script to keep being in memory. Pay attention you need to show the window manually using Windows->Palels->Command panel. In 2023.23 this last action no longer needed, and the proxy tool will not appear as well. #include <CoreAPI.h> #include <coat\PopupWindows.h> class CmdPanel :public PopupWindow { public: CmdPanel() { } virtual const char* GetWindowID() override { return "Command Panel"; } void Button1() { coat::ui::cmd("$MENU_INVERT_FREEZE"); } void Button2() { coat::ui::cmd("$InvertHide"); } // etc... SERIALIZE() { { UI_LAYOUT("1"); FUNCTION_CALL(Button1, "Invert Freeze"); FUNCTION_CALL(Button2, "Invert Hidden"); // etc... } } }; class Keeper :public VoxelExtension { public: CmdPanel* panel; Keeper() { panel = new CmdPanel(); PopupWindow::Register(panel); panel->Show(); } ~Keeper() { delete panel; } }; EXPORT int main() { VoxelExtension::Register(new Keeper); return 0; }
-
Cant change layer blending modes with scroll wheel anymore
Andrew Shpagin replied to Empyror's question in Questions & Answers
You need to click on the droplist first, then use wheel. -
changing parent with Python: nothing happens?
Andrew Shpagin replied to kritskiy.001's topic in Scripting
Fixed in 28 (will be released in 1-2 days)- 1 reply
-
- 2
-
[Bug] Smooth Freezing doesn't seem to be doing anything ?
Andrew Shpagin replied to DMG's topic in Sculpting
Please check 18 build.