db&w documentation wiki

finest software | finest docs

Site Tools


tools:opendir

Open Directory

This is a small generic plugin that can be used to open any directory in Explorer / Finder (depending on the platform).

By default this will open the settings directory, but can be used in simple scripts to open any directory.

The following script uses this plugin to open the content directory.

OpenDir.py
# -*- Mode: Python -*-
# -*- coding: ascii -*-
 
"""
This is a LightWave Generic plug-in that opens a directory,
in this case the content directory using a magic string
"""
 
__author__     = "Michael Wolf"
__date__       = "Jan 21 2020"
__copyright__  = "Copyright (C) 2020 db&w GbR"
__version__    = "1.0"
__maintainer__ = "Michael Wolf"
__email__      = "michael.wolf@db-w.com"
__status__     = "Example"
__lwver__      = "2018"
 
try:
    import lwsdk
except ImportError:
    raise Exception("The LightWave Python module could not be loaded.")
 
ga = lwsdk.GenericAccess()
if ga.valid():
    name = "Content"
    ga.evaluate("Generic_dbwOpenDir %s" % name)

Pre-defined directory names

LightWave 3D uses certain “magic” directory names for directories relevant to the current instance of LightWave 3D. These can be passed on to the plugin.

If the directory doesn't match any of these, it will be assumed to be a full path and then opened.

Name Description
ContentCurrent content directory
AnimationsAnimation directory in the current content directory
ImagesImage directory in the current content directory
EnvelopesEnvelope directory in the current content directory
MotionsMotion directory in the current content directory
ObjectsObjects directory in the current content directory
Plug-insPlugins directory in the current installation(!) directory
PreviewsPreviews directory in the current content directory
PSFontsDirectory used by Modeler to load additional Postscript fonts to be used by the Text tool
ScenesScenes directory in the current content directory
SettingsSettings directory for LightWave 3D, usually located within the user profile
SurfacesSurface directory in the current content directory
NodesNodes directory in the current content directory
SoundsSounds directory in the current content directory
DynamicsDynamics directory in the current content directory
RigsRigs directory in the current content directory
InstallInstallation directory of LightWave 3D
LightsLights directory in the current content directory
RadiosityRadiosity directory in the current content directory
VertCacheCertex Cache directory in the current content directory
ShadersShaders directory in the current content directory, not used anymore

This is a small bonus plugin for January 2020, made possible by the finest patrons on Patreon.

tools/opendir.txt · Last modified: 2020/01/24 15:19 by lightwolf