Jump to content

Justin Smith

Member
  • Posts

    32
  • Joined

  • Last visited

Posts posted by Justin Smith

  1. Curious if it's possible to Customize Spotlight (or any other included, standard) plugins that come with the Vectorworks suites, beyond just adding parameters.

    I see that it's possible to add additional parameters to the plugin records. I'm using this for instance with the LED Screens plugin. I've added a weight parameter and I can now calculate the weights of the screens directly in my worksheets. That's great, however, I'd like to extend my customized LED Screen plugin with actual code too!

    Currently the plugin only works with labels in the 2D View. In this case I'd like to create a 3D label that is added to the LED Screen in 3D, in addition to the standard functionality. Ideally I'd like to execute code after the rest of the plugin is done generating the geometry. It'd be great if this was part of the "Customized" plugin itself. However, if that's not possible, what about a second script that comes in after the fact and adds the 3D label to all of my LED plugins?? I guess that would work, I'd just have to iterate through the drawing and search for plugins records that match the LED Screen Record, correct? Would I be able to add my geometry inside the individual LED Screen PIO's, or would they have to be outside that PIO geometry?

    Thanks for any insight

  2. Still would love some insight here. The workflow I'm trying to accomplish is loading up images from disk automatically (based on a worksheet) and then creating a renderworks texture out of them.

    So far I can only figure out how to import the images as an image and can't convert them to a textureBitmap.

    Here's code (partially taken from a VW sample plugin). How or what could I do to instead of insert a image below insert a bitmapTexture?

    def getImageForFileName(fileName, err, dirPath):

    #uses FSActLayer so I think I need to deselect

    vs.DSelectAll()

    major, minor, maintenance, platform = vs.GetVersion()

    isMac = False

    if platform == 1: isMac = True

    # define a location to import the images

    importPt = (0,0)

    if err == 0: # no-error

    hsfDirPath = dirPath

    if isMac: ok, hsfDirPath = vs.ConvertPosix2HSFPath( dirPath )

    fileIndex = 1

    fileName += ".png"

    name, ext = os.path.splitext( fileName )

    if ext.lower() == '.png':

    imagePath = os.path.join( dirPath, fileName )

    vs.ImportImageFile( imagePath, importPt )

    hImage = vs.FSActLayer()

    if hImage == 0:

    vs.AlrtDialog("No image with name '", fileName, "' in directory " , dirPath)

    return hImage

  3. Here's my base functions that load up a symbol in the folder inside my plugins user folder called "JRSPlugins/JRSPythonProjectsLinked/VWXSymbols"

    I have a gist of this code here: https://gist.github.com/justinmilo/d85a048cb1ec4ce54270#file-jsbase-py

    ef JRSymbol(name, x, y, rotation):

    if not symbolExists(name):

    importSymbol(name)

    vs.Symbol(name, x, y, rotation)

    return vs.LNewObj()

    def importSymbol(id):

    aListID = 1

    objectType = 16 #Symbol Index

    folderIndex = -2 # Plug-In Data Folder (negative means user folder)

    aListID, numOfItems = vs.BuildResourceList( objectType , folderIndex, "JRSPlugins/JRSPythonProjectsLinked/VWXSymbols")

    aString = ""

    for i in range(0, numOfItems):

    #myInt = vs.InsertImagePopupResource (dialog1, 4, aListID, i)

    name = vs.GetNameFromResourceList (aListID, i)

    if name == id:

    vs.ImportResourceToCurrentFile(aListID, i)

    def symbolExists (id):

    objectType = 16 #Symbol Index

    folderIndex = 0 # Current Document

    aListID, numOfItems = vs.BuildResourceList( objectType , folderIndex, "")

    for i in range(0, numOfItems):

    name = vs.GetNameFromResourceList (aListID, i)

    if name == id:

    return True

    return False

    def Symbol2D3D(SymString, X, Y, Z, Xr, Yr, Zr):

    JRSymbol (SymString, X, Y, Xr)

    vs.Move3DObj(vs.LNewObj(), 0, 0, Z)# to move an individual

  4. Questioning wether the issue i'm seeing is related to the same depreciated calls

    I'm having issues with vector script Modern Dialogs that work fine in 2014, but they are ?not working? in 2015.

    The dialog seems collapsed in 2015.

    I am wondering if it has something do to with the swap to cocoa. I'm running OS X Mavericks.

    screenshots below:

    https://www.dropbox.com/sh/0u0g3m6e4tpij75/AADsXpB8e4sFLPhazlCDvVtma?dl=0

    The code is as follows:

    dialog1 = vs.CreateLayout('Select From this list', False, 'OK', '')

    vs.CreateStaticText( dialog1, kListBox1, "My test String", -1 );

    vs.CreateControl(dialog1, 4, ImagePopup, 'displayName', 0)

    vs.SetFirstLayoutItem(dialog1, 4)

    vs.SetBelowItem(dialog1,4, kListBox1, 0, 0)

    myInt = vs.RunLayoutDialog(dialog1, dialog2_Handler)

  5. Has anyone else run into an issue where bitmap images won't show up in OpenGL rendered viewports? Bitmaps seem to always show in my design layer views but as soon as I bring them into a viewport they vanish. Only show up with wireframe.

    I've checked the usual suspects and have Planar display on. I've also made sure my OpenGl viewport settings are the same as my Layer OpenGL settings.

    This might be related to an issue where render works can't render bitmap images in some case, which Jim let me know is a known issue. Here's my post on that.

    https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Main=39870&Number=198509#Post198509

  6. Anyone know how CreatePaintFromImage or CreatePaintFromImgN are supposed to work?

    I've tried passing both an image (14) and a TextureDefinitionMaterial (97) and get back a nil obj.

    I'm also not exactly sure what a "paint node" is.

    "Return Value

    Returns the handle to the newly created paint node."

    My hope was that it would take a bitmap image and convert it to a texture bitmap.

  7. So it definitely appears that I need to be using a bitmap texture with vs.SetTextureBitmap(shaderRecord, textureBitmap):

    What I need to figure out is if its possible to go from a bitmap image to a bitmap texture. Some of the paintnode Functions perhaps?

  8. So i'm running into the same issues. Not really sure what this image texture (93) is or how that relates to a bitmap (14).

    I'm trying to go the other way, from a bitmap to a texture. I want to grab existing bitmaps from the drawing (not bring up a dialog box that asks to locate an image). Can't seem to figure it out.

  9. Any one have any luck with this function?

    def vs.SetTextureBitmap(shaderRecord, textureBitmap):

    return None

    I'm trying to pass a bitmap image (ObjectId 14) into the function. Doesn't seem to be working. Do I need to be using a bitmap texture?

    What I'm trying to do is take a Bitmap Image object and make it into a texture with an image shader. I make the texture fine, I can add the shader record. Just can't seem to add a bitmap to the texture. Specifically want to add a bitmap that is already in the document but not setup as a render works texture.

×
×
  • Create New...