Jump to content

External Python Packages


Recommended Posts

Hello,

I use external packages in python. I'm wondering what's the best way to distribute them to the plug-ins users. It's apparently bad to place them in the plug-ins folder because Vectorworks goes through all the subfolders of "Plug-ins" at startup looking for plug-ins files

I think I could create a Python folder in the user application folder.

Do you think it can be damaging to the application to have an extra folder full of subfolders in the user's application folder (next to Plug-ins, Libraries, Workspaces, ...) ?

Do you have better ways to distribute external python packages ?

Thank you,

Regards,

Link to comment

Short answer -- yes, you can provide a directive to VW's encryption process to include modules. Just as with encrypting VS, the module gets sucked into to the distributed plug-in.

They key is including an xml file with the same name and in the same location as the plug-in you wish to package.




{full path to plug-in to encrypt}
{relative path to module file 1}
{relative path to module file 2}


Notes:

- The xml flags are case sensitive

- Use the Path parameter if you are packaging a file the resides outside of your plug-ins folder (I keep all my code files in Dropbox and manage with git

Example:

I have a project in:

Users/myname/Projects/Project 1

In the Project 1 folder I have:

|_ _Encrypt

|_ thePlugin.vso

|_ thePlugin.xml

|_ lib

|_ __.init__.py

|_ piolib.py

|_ thePlugin

|_ __.init__.py

|_ _main.py

The xml looks like:




/Users/myname/Projects/Project 1/_Encrypt/
thePlugin/_main.py
lib/piolib.py


It's been a while since I got this working smoothly, so feel free to contact me privately with questions.

-Josh

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...