Kstudio plugins has MAXScript API, which can be used for solutions to your specific tasks.
This reference to understand how to use and develop a connection or automation with Kstudio plugins.
Note: you can find additional examples in the directory “presets”
If you want to expand the Kstudio plugin capabilities with the API and don’t own knowledge of maxscript please refer to email email@example.com
API for Project Manager, Models Manager and Materials Manager
This is the main API struct for Kstudio Managers plugins.
Can be used for adding a custom menu item – see moreGetSelectedItemsInfo IncludeMaps:<bool> IncludeThumbs:<bool> - Returns the Array of struct for Selected Items IncludeMaps: Returns the Array of external files, used by item (Available for Materials and 3ds Max files(max file must be saved in 3ds max version 2010 or above)) IncludeThumbs: Returns a path to file, which used for preview Each element has next properties: Item: Returns a path to file or Material/textureMap Assets: Array of external files, used by item (IncludeMaps must set to true) Thumbnail: Returns a path to file, which used for preview (IncludeThumbs must set to true) RemoveSelection(): Removes Selected Items only from ListView (without any changes for files on HDD!) Refresh(): Refresh all items in ListView SaveScreenShot file: Save a screenshot from active viewport to file CurrentFolder: Returns a path to current directory (or path to material library file) Example:SelectedStruct = PMStructureInfo() SelectedStruct.CurrentFolder => "C:\Temp\" SelectedStruct.Refresh() file = @"C:\Temp\Screen.jpg" SelectedStruct.SaveScreenShot file SelectedStruct.RemoveSelection() selectedItems = SelectedStruct.GetSelectedItemsInfo() /* get array of files from selectedItems */ selectedFiles = for item in selectedItems collect item.Item /* or Array of selected materials from opened Material Library */ selectedMats = for item in selectedItems where superClassOf item.Item == material collect item.Item /* print array of external files, used by item */ for item in selectedItems do ( format "%\n" item.Item format "Asset Files:\n" for file in item.Assets do format "\t%\n" file ) /* Result: "C:\Temp\SomeModel.max" Asset Files: "C:\Temp\Maps\Bitmap_1.jpg" "C:\Temp\Maps\Bitmap_2.jpg" */
Use this function for filtering merged objects, setting a desired name for objects or other operations.PMpostrFileMerge &PostrMergeStruct File:mergedFile Nodes:MergedObjects ParentNode:ParentNode PostrMergeStruct: struct of some additional parameters. Now has one parameter: UsePlaceDialog. Set UsePlaceDialog to false for disable the open default Place Dialog after merging. File: Returns a full path to merged file MergedObjects: Array of merged nodes ParentNode: In case if nodes is groupped it returns a group head. In case if nodes count equals one it returns a node. Example: Set desired name for merged nodes Note: place this script to scripts startup directoryfn PMpostrFileMerge &PostrMergeStruct File: Nodes: ParentNode: = ( if isValidNode ParentNode and not isDeleted ParentNode do ParentNode.Name = uniqueName (getFilenameFile File) )