TACTIC Open Source
VFX Plugins - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Announcements (http://forum.southpawtech.com/forumdisplay.php?fid=5)
+--- Thread: VFX Plugins (/showthread.php?tid=114)

Pages: 1 2 3


RE: VFX Plugins - Nachogor - 05-29-2020

AWESOME!!!!!!!! Now the big question: how should I create the plugins? Just writing code or exporting information somehow from the template I already have?
Excuse my ignorant question, but I´m a begginer in terms of coding.

Thanks!
Nacho


RE: VFX Plugins - Nachogor - 06-01-2020

Hi Remko!

I created a couple of scripts to generate the spt files from lists and from Csv exported from tactic, but it's quite hard to create the triple " as a script. Is it necessary for spts to have the triple " in each string value?

Thanks!
Nacho


RE: VFX Plugins - remkonoteboom - 06-02-2020

The spt file is actually an executable python script (it has to run in a specific context, namely the Plugin loader, mostly because of assumed variables), but the only requirement is that it is valid Python. The only reason we use triple quotes is because Python is excellent at handling long multi-line strings (I have never seen anything better in any language I have ever programmed in). So rather than creating a file format that has all these parsing problems, I just made it in to a Python file and then call "exec()" on the whole thing. You can even put variables and loops in there if you really want. The other thing that is really nice about using Python as well as Python long strings was our design requirement that plugins diff correctly on tools like Git even though the column names contained structures like json and XML.

HOWEVER, the plugin manifest can export itself. You don't have to write a CSV exporter. In the Plugin Manager, just select your plugin, go to the "Manifest" tab and click "Export". All the spt files will be generated automatically.

If ever you do need to run some custom python code, there is a tag in the manifest that can run arbitrary python scripts:

<python path="sql_upgrade.py" undo_path="sql_upgrade_undo.py"/>

We usually put some logic here, mostly to do some database preparation or adding new columns.

There is some documentation here:
http://community.southpawtech.com/docs/developer/packaging-a-plugin/

I do realize that these docs are kind of thin and there is a *LOT* more you can do with plugins than is described here. We're going to have to update this at some point. Until then, you can just ask questions here. At some point I can take all of this writing and make it into real docs.


RE: VFX Plugins - Nachogor - 06-02-2020

Thanks Remko!
The csv exporter in my case is a way to generate the spt file from the naming csv of a project. Is this possible from Tactic?
I understand I need to generate all the spt files, upload them and then create the manifest from tactic. Is this right?

Thanks!
Nacho


RE: VFX Plugins - listy - 06-02-2020

(06-02-2020, 02:20 PM)Nachogor Wrote: Thanks Remko!
The csv exporter in my case is a way to generate the spt file from the naming csv of a project. Is this possible from Tactic?
I understand I need to generate all the spt files, upload them and then create the manifest from tactic. Is this right?

Thanks!
Nacho
You can still generate spt's from your existing project by running tactic.ui.table.ProjectTemplateUpdateWdg.
Can be executed from Projects table, just enable "Template Update" column


RE: VFX Plugins - Nachogor - 06-02-2020

STUPID MEEEEEE! I've been working with my template.zip for years, and never opened the zip to find out all the spts are there! I spent a couple of hours recreating them from scratch. ARGHHHHH!!!! Thanks Listy!!!!


RE: VFX Plugins - Nachogor - 06-02-2020

Hi guys!

I tried uploading files to create the Pluigin but I came across this error: "module 'string' has no attribute 'lower'"
Anyone having this same error?

Log below

Starting TACTIC v4.8.0.b01 ...

IS UPLOAD
DEPRECATED: dynamic file in app_server.py
num_files: 1
files: ['/opt/tactic/tactic_temp/upload/93625e37a20f3f8f5f2/LaSP_planos.spt']
---
user: admin
timestamp: 2020-06-02 17:08:25
method: execute_cmd
ticket: 93625e37a20f3f8f5f2
( 'tactic.ui.app.PluginDirListActionCbk',
{ 'action': 'upload',
'dirname': 'ramon_plugin_stypes_001',
'upload_file_name': 'LaSP_planos.spt'},
{},
{})
Error: module 'string' has no attribute 'lower'
--------------------------------------------------
File "/opt/tactic/tactic/src/pyasm/command/command.py", line 267, in execute_cmd
ret_val = cmd.execute()
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 274, in execute
self2.results = exec_meth(self, ticket, meth, args)
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 304, in exec_meth
results = meth(self, ticket, *new_args)
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 5802, in execute_cmd
Command.execute_cmd(cmd)
File "/opt/tactic/tactic/src/pyasm/command/command.py", line 267, in execute_cmd
ret_val = cmd.execute()
File "/opt/tactic/tactic/src/tactic/ui/app/plugin_wdg.py", line 2681, in execute
basename = File.get_filesystem_name(basename)
File "/opt/tactic/tactic/src/pyasm/biz/file.py", line 388, in get_filesystem_name
ext = string.lower(ext)

Error: module 'string' has no attribute 'lower'
--------------------------------------------------
--------------------------------------------------
From ExceptionLog.log
--------------------------------------------------
File "/opt/tactic/tactic/src/pyasm/command/command.py", line 267, in execute_cmd
ret_val = cmd.execute()
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 274, in execute
self2.results = exec_meth(self, ticket, meth, args)
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 304, in exec_meth
results = meth(self, ticket, *new_args)
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 5802, in execute_cmd
Command.execute_cmd(cmd)
File "/opt/tactic/tactic/src/pyasm/command/command.py", line 267, in execute_cmd
ret_val = cmd.execute()
File "/opt/tactic/tactic/src/tactic/ui/app/plugin_wdg.py", line 2681, in execute
basename = File.get_filesystem_name(basename)
File "/opt/tactic/tactic/src/pyasm/biz/file.py", line 388, in get_filesystem_name
ext = string.lower(ext)

module 'string' has no attribute 'lower'
--------------------------------------------------
--------------------------------------------------
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 583, in new
cmd.execute_cmd(cmd)
File "/opt/tactic/tactic/src/pyasm/command/command.py", line 267, in execute_cmd
ret_val = cmd.execute()
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 274, in execute
self2.results = exec_meth(self, ticket, meth, args)
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 304, in exec_meth
results = meth(self, ticket, *new_args)
File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 5802, in execute_cmd
Command.execute_cmd(cmd)
File "/opt/tactic/tactic/src/pyasm/command/command.py", line 267, in execute_cmd
ret_val = cmd.execute()
File "/opt/tactic/tactic/src/tactic/ui/app/plugin_wdg.py", line 2681, in execute
basename = File.get_filesystem_name(basename)
File "/opt/tactic/tactic/src/pyasm/biz/file.py", line 388, in get_filesystem_name
ext = string.lower(ext)

Error: module 'string' has no attribute 'lower'
--------------------------------------------------
request_id: 139714472437504 - #0000001
timestamp: 2020-06-02 17:08:25
user: admin
simple method: <function ApiXMLRPC.get_widget at 0x7f11e73ff200>
ticket: 93625e37a20f3f8f5f2
( 'tactic.ui.app.plugin_wdg.PluginEditWdg',
{ 'args': { 'dirname': 'ramon_plugin_stypes_001',
'is_refresh': 'true',
'plugin_dir': '/opt/tactic/tactic_data/plugins/ramon_plugin_stypes_001',
'selected': 'files'},
'libraries': { 'spt_button': True,
'spt_calendar': True,
'spt_help': True,
'spt_html5upload': True,
'spt_icon_button': True,
'spt_mobile_table': True,
'spt_popup': True,
'spt_tab': True,
'spt_table': True,
'spt_view_panel': True},
'values': { 'Upload': 'LaSP_planos.spt',
'code': 'ramon_plugin_stypes_001',
'description': 'Genera los sTypes necesarios para un '
'proyecto de RAMON',
'manifest': '<manifest>\n'
' <data>\n'
' <code>ramon_plugin_stypes_001</code>\n'
' <title>Ramon_Plugin_Stypes_001</title>\n'
' <description>Genera los sTypes '
'necesarios para un proyecto de '
'RAMON</description>\n'
' </data>\n'
'</manifest>\n',
'title': 'Ramon_Plugin_Stypes_001',
'value': '',
'version': 'DEV'}})

SQL Query Count: 11
BVR Count: 83
Sending: 76.5810546875 KB
Num SObjects: 2
Duration: 0.032 seconds (request_id: 139714472437504 - #0000001)
Memory: 71476 KB
Increment: 12140 KB


RE: VFX Plugins - remkonoteboom - 06-03-2020

Python 3 bug. This has been fixed here:

https://github.com/Southpaw-TACTIC/TACTIC/pull/1461/commits/f613809c111264bf151183a38368ee766d7f4cce

For the future, if it is clearly a bug, ie: there is a stack trace, could you just log the issue in Github?

https://github.com/Southpaw-TACTIC/TACTIC/issues

This is where we track all development of TACTIC code. If you are not sure, by all means, post here, but in Github, we will track the status of it. In this case, it was a one line fix, so it could be fixed quickly, but it won't always be possible.


RE: VFX Plugins - Nachogor - 06-03-2020

Thanks Remko!



It worked! I have no experience in Github, but I will take a look at it now. Sould I log it in "ISSUES"? 




The manifest should be created automatically? Files aren`t added in my case.


Plugin Type should be Project for Stypes and Widget for Configs?



Thanks!!!



Nacho


RE: VFX Plugins - remkonoteboom - 06-03-2020

Yes, log it in "issues". We just started using it to track Open Source issues. Let us know what you think.