VS:GetTextureRefN: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
m (Transfer Orso to _c_)
 
(2 intermediate revisions by 2 users not shown)
Line 46: Line 46:


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark></remark>
<remark>[[User:CBM-c-|_c_]] (2017.12.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 07:47, 30 December 2020

.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

_c_ (2017.12.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