Difference between revisions of "VS:GetTextureRefN"

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
(add comment, example)
 
Line 46: Line 46:
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
<remark></remark>
+
<remark>([[User:Orso.b.schmid|Orso]], 2017 Dec. 30): This was always a cryptical call, below an example from my own notes:
 +
<code lang="vs">
 +
{ set texLayerID to 0, if you don't have decals you want to access }
 +
 
 +
GetTextureRefN(obj, 3, 0, FALSE);
 +
{ returns info on the overall part (3)
 +
* texture index if the part is "texture" 
 +
* 0 if the part is "None" 
 +
* -1 if the part is "Class Texture" 
 +
}
 +
 
 +
GetTextureRefN(obj, 3, 0, TRUE);
 +
{ returns info on the overall part (3)
 +
* texture index if the part is "texture" 
 +
* 0 if the part is "None" 
 +
* index of the class texture if the part is "Class Texture" 
 +
}
 +
</code></remark>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------

Latest revision as of 10:40, 30 December 2017

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix


Description

Returns the texture reference for a specified object.
FUNCTION GetTextureRefN(
obj  :HANDLE;
texPartID  :LONGINT;
texLayerID  :LONGINT;
resolveByClass  :BOOLEAN) : LONGINT;
def vs.GetTextureRefN(obj, texPartID, texLayerID, resolveByClass):
    return LongInt

Parameters

obj HANDLE
texPartID LONGINT
texLayerID LONGINT Texture layer ID, 0 for base, >0 for decals
resolveByClass BOOLEAN

Remarks

(Orso, 2017 Dec. 30): This was always a cryptical call, below an example from my own notes:
{ set texLayerID to 0, if you don't have decals you want to access }

GetTextureRefN(obj, 3, 0, FALSE); 
{ returns info on the overall part (3)
* texture index if the part is "texture"  
* 0 if the part is "None"   
* -1 if the part is "Class Texture"  
}

GetTextureRefN(obj, 3, 0, TRUE); 
{ returns info on the overall part (3)
* texture index if the part is "texture"  
* 0 if the part is "None"   
* index of the class texture if the part is "Class Texture"  
}

Version

Availability: from Vectorworks 2010
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox