Garry's Mod Wiki

util.RelativePathToGMA_Menu

  table util.RelativePathToGMA_Menu( string filePath )

Description

Returns which Workshop addon the given file belongs to.

Arguments

1 string filePath
The relative path to a file, such as materials/myMaterial.vmt.

Returns

1 table addonInfo
The info about owner addon. Will return nil if the file doesn't belong to an addon. Table Structure:
Author = [Addon Author] File = [Steam folder]\workshop\content\4000\[Addon ID]/[GMA Name].gma ID = [Addon ID] Title = [Addon Title]

Example

Prints the AddonInfo of the given Path (The Addon the file belongs to.)

PrintTable( util.RelativePathToGMA_Menu( "[Insert here something from an addon like a Model]" ) ) -- prints the AddonInfo
Output:
Author = [Addon Author] File = [Steam folder]\workshop\content\4000\[Addon ID]/[GMA Name].gma ID = [Addon ID] Title = [Addon Title]