PDA

View Full Version : Example files: "basic_barn.py" not being recognized in Menu Editor -11.6.3 & 2015.3



jeric_synergy
09-24-2015, 07:54 PM
Here's my experience:


I attempted to add "basic_barn.py" as a plugin.
Layout indicated it successfully added 3 (?) plugins.
In the Menu Editor, neither "barn" nor "basic" was Found.
"basic_barn.py" was listed in the EDIT PLUGINS panel.



Here's the code as on my machine:

#! /usr/bin/env python
# -*- Mode: Python -*-
# -*- coding: ascii -*-

"""
This is a LightWave Custom Object plug-in based on the LWSDK sample.
"""

import sys
import lwsdk

__author__ = "Bob Hood"
__date__ = "Sep 12 2011"
__copyright__ = "Copyright (C) 2011 NewTek, Inc."
__version__ = "1.0"
__maintainer__ = "Bob Hood"
__email__ = "[email protected]"
__status__ = "Example"
__lwver__ = "11"


# instance globals (shared by all instances)

vert = [ [0.0, 0.0, 0.0],
[1.0, 0.0, 0.0],
[1.0, 1.0, 0.0],
[0.5, 1.5, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, -1.0],
[1.0, 0.0, -1.0],
[1.0, 1.0, -1.0],
[0.5, 1.5, -1.0],
[0.0, 1.0, -1.0] ]

edge = [ [0, 1],
[1, 2],
[2, 3],
[3, 4],
[4, 0],
[5, 6],
[6, 7],
[7, 8],
[8, 9],
[9, 5],
[0, 5],
[1, 6],
[2, 7],
[3, 8],
[4, 9],
[1, 4],
[0, 2] ]

class basic_barn(lwsdk.ICustomObj):
def __init__(self, context):
super(basic_barn, self).__init__()

self._itemid = context

# LWCustomObjHandler ----------------------------------
def evaluate(self, ca):
global vert, edge
for i in range(0, 15):
ca.line(ca.dispData,
vert[edge[i][0]],
vert[edge[i][1]],
lwsdk.LWCSYS_OBJECT)

ca.setPattern(ca.dispData, lwsdk.LWLPAT_DOT)

for i in range(15, 17):
ca.line(ca.dispData,
vert[edge[i][0]],
vert[edge[i][1]],
lwsdk.LWCSYS_OBJECT)

# LWInstanceFuncs -------------------------------------
def inst_descln(self):
return RESOURCE % "Python Basic Barn"

ServerTagInfo = [
( "Python Basic Barn", lwsdk.SRVTAG_USERNAME | lwsdk.LANGID_USENGLISH ),
( "Basic Barn", lwsdk.SRVTAG_BUTTONNAME | lwsdk.LANGID_USENGLISH ),
]

ServerRecord = { lwsdk.CustomObjFactory("LW_PyBasicBarn", basic_barn) : ServerTagInfo }

ernpchan
09-24-2015, 08:38 PM
Per this comment in the script:


This is a LightWave Custom Object plug-in based on the LWSDK sample.

Add a null and you'll find it under the 'Add Custom Object' pulldown, 'Python Basic Barn'.

jeric_synergy
09-24-2015, 08:47 PM
Per this comment in the script:

Add a null and you'll find it under the 'Add Custom Object' pulldown, 'Python Basic Barn'.
---ok, my bad, but I'm used to looking for plugins in the Menu Editor.