fuberator Posted January 19, 2023 Share Posted January 19, 2023 (edited) Hi I would like to find out how to make a palette with a few functions. A lot of times I want to work in shaded mode and I need to disable light fixtures temporarily to work in the default light, and then turn them back on to visualise what they are doing. To Quickly compose looks it would be marvellous to have a floating window/palette with everything that can be found in the render section of Lighting Device→OIP: EDIT dialogue Lighting Device → OIP: Edit → Tab: Light Information → Section: Render How would I go about this. Is there an example of a custom window/palette that I could try to build from? Thank you Edited January 19, 2023 by fuberator Quote Link to comment
Pat Stanford Posted January 19, 2023 Share Posted January 19, 2023 If you want the Default light, you can't just turn the lights off, you actually have to make them invisible. The easiest way is to edit your workspace and add Custom Visibility from the Legacy menu commands. From there you need to make two scripts: 1. Select Command to Show, Create Vectorscript, Hit the Criteria Button and set it to All Objects. Click OK. This will give you a script that will make everything visible again after you have hidden them. 2. Command is Hide, Create Vectorscript, Criteria is Type is Light. This will hide all of your lights. You might want a third script also. Command is Hide, Create Vectorscript. Criteria is Selected. This on will hide all of the selected objects. Useful to get things out of the way. 1 Quote Link to comment
MullinRJ Posted January 20, 2023 Share Posted January 20, 2023 To the best of my knowledge, you cannot create a persistent floating palette as you pictured above. You can create a dialog with those options, but it needs to open and close so you can continue editing your file. I believe what @Pat Stanford is suggesting is creating a Script Palette that contains Pascal or Python commands to achieve the various drawing states you desire. You can also turn these script commands into Menu Commands, which can be loaded into your workspace and assigned hotkeys. These would be available in every open file (new or old), as opposed to a Script Palette which would have to exist in each file, either by copying it in, or adding it to your Template Files. Menu commands can perform simple or complex functions, and if you need to provide user input, they can open dialogs like the one you designed above. If you need help going down one of these paths, please write back. Raymond 1 Quote Link to comment
fuberator Posted January 20, 2023 Author Share Posted January 20, 2023 Hi Thank you for your answers. I think maybe I should clarify my intentions. As I am considering positions and moving things about it is not optimal that the scene is darkened and only illuminated by the devices. I do however want to switch to a "lit" scene every once in a while to see what it looks like. So far it is all about that on/off toggle. To have access to color and brightness would be a bonus of course. Like a simple little light desk. So in the best case scenario I would keep the lighting devices visible (otherwise I could just turn a layer off with all devices on it). @MullinRJThe script menu command with hotkey sounds great. My programming skills are limited, but if I could look at some examples I might be able to cobble something together, at least for the on/off toggle. Is there a resource for this that you can recommend as a starting place? Thank you Quote Link to comment
MullinRJ Posted January 20, 2023 Share Posted January 20, 2023 Hi @fuberator, There are several documents you need to script effectively. 1) The VW Script Function Reference. There is an HTML version in the VW Application folder, here: /VWHelp/Script Reference/ScriptFunctionReference.html. 2) There is also an online version of the same document, and a whole lot more at: https://developer.vectorworks.net/index.php/Main_Page 3) There are files in the SDK containing lists of the constants used in the program. You can download the SDK here: https://www.vectorworks.net/support/custom/sdk/sdk_license The files you need most are : ProgramVariables.h and ObjectVariables.h, located in the SDKLib/Include/Kernel/API/ directory. If you get this far you're probably numb from the neck up. Sadly, there is not an official Starting Place. We all recommend jumping in then requesting a life preserver. Luckily, there are many people standing around who will gladly throw you a floating device. But, to give you a nudge in the right direction, look in the VW Script Function Reference for the commands that @Pat Stanford mentioned above. You'll have lots of questions, and we'll have lots of answers. Good luck and welcome to the Deep End of the Pool, Raymond 1 Quote Link to comment
Sam Jones Posted January 21, 2023 Share Posted January 21, 2023 On 1/19/2023 at 8:32 AM, Pat Stanford said: 1. Select Command to Show, Create Vectorscript Where would this command be? I cannot find it in the Workspace Editor. Quote Link to comment
Pat Stanford Posted January 21, 2023 Share Posted January 21, 2023 @Sam Jones The commmand I was talking about is Custom Visibility. It should be in the Legacy folder of the Menu Commands. Quote Link to comment
Sam Jones Posted January 21, 2023 Share Posted January 21, 2023 @fuberator First, you can go to the Default light by going to Top Plan view. I don't know what conditions might change this, but it is working for me. Perhaps this only works if the lights in the scene are only contained in Lighting Devices. Second, I'm working on enhancing a command that I have already made to do much of what wish for. Currently it only turns the beams on in the OIP, but turning the light objects on and off for rendering looks very doable. See image of the current command dialog below; it will need to be expanded. For your own programming investigations, you should know that while the programming isn't rocket science, but it does involve getting the profile group of each Lighting Device, polling the objects in that group and finding the lights, then turning them on and off with procedures specific to Light objects. I'll keep you informed of my progress. Quote Link to comment
BartH Posted January 22, 2023 Share Posted January 22, 2023 On 1/19/2023 at 8:32 AM, Pat Stanford said: 2. Command is Hide, Create Vectorscript, Criteria is Type is Light. This will hide all of your lights. I notice I had to add a second line in the criteria for Heliodons, but this is a great addition to my toolset! Bart Quote Link to comment
fuberator Posted January 22, 2023 Author Share Posted January 22, 2023 23 hours ago, Sam Jones said: @fuberator First, you can go to the Default light by going to Top Plan view. I don't know what conditions might change this, but it is working for me. Perhaps this only works if the lights in the scene are only contained in Lighting Devices. Second, I'm working on enhancing a command that I have already made to do much of what wish for. Currently it only turns the beams on in the OIP, but turning the light objects on and off for rendering looks very doable. See image of the current command dialog below; it will need to be expanded. For your own programming investigations, you should know that while the programming isn't rocket science, but it does involve getting the profile group of each Lighting Device, polling the objects in that group and finding the lights, then turning them on and off with procedures specific to Light objects. I'll keep you informed of my progress. Hi Very exciting! I had a look and realised this would have to be a future project as it would take too much time to even enter. ciao! Quote Link to comment
Sam Jones Posted January 22, 2023 Share Posted January 22, 2023 @fuberator or anyone else. I'm starting to implement a menu command that will execute the result of the dialog below. Feel free to comment before it gets written in stone. Quote Link to comment
Elite Exhibits Posted January 23, 2023 Share Posted January 23, 2023 fuberator Is this a similar topic on Light Visibility ? Peter Quote Link to comment
fuberator Posted January 23, 2023 Author Share Posted January 23, 2023 19 hours ago, Sam Jones said: @fuberator or anyone else. I'm starting to implement a menu command that will execute the result of the dialog below. Feel free to comment before it gets written in stone. Love it! Quote Link to comment
fuberator Posted January 23, 2023 Author Share Posted January 23, 2023 3 hours ago, Elite Exhibits said: fuberator Is this a similar topic on Light Visibility ? Peter Yes, this thread is consequential, as there is no available function to do it. Why? Quote Link to comment
Sam Jones Posted January 26, 2023 Share Posted January 26, 2023 Here is a menu command that does much of what has been discussed here. Placing it in the Plug-Ins folder of the 2023 user folder and then adding the command to your workspace should make it available to you. It will be a part of the next version upload of AutoPlot Tools for Spotlight, so it will stop being functional 2 months after its first use, but it should be fully functional until then. Let me know if you have any coments, questions, or problems. Sam sjones@autoplotvw.com Beam Console New.vsm 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.