VS:ResolveByClassTextureRef: Difference between revisions
m (1 revision) |
Juliancarr (talk | contribs) mNo edit summary |
||
Line 54: | Line 54: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
If the texture ref for an object is set to -1, it will use the texture of its class. This routine will look up the object's class and return the class' texture ref.</remark> | If the texture ref for an object is set to -1, it will use the texture of its class. This routine will look up the object's class and return the class' texture ref. | ||
Julian Carr [25 April 2014]: I don't believe this works as described. If you create an extrude, put it in a class that has a texture applied in the Other tab, then run this code: | |||
Message(ResolveByClassTextureRef(FSActLayer, -1)); | |||
it will only return a value if the selected extrude has the Texture popup set to Class Texture in the OIP. Otherwise it returns 0. It does not apply the class texture to the object | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample> | <sample> | ||
==== VectorScript ==== | |||
<code lang="pas"> | <code lang="pas"> | ||
textureID := ResolveByClassTextureRef(handleToObject, 0);</code> | textureID := ResolveByClassTextureRef(handleToObject, 0);</code> | ||
==== Python ==== | |||
<code lang="py"> | |||
</code> | |||
</sample> | </sample> | ||
Latest revision as of 02:24, 26 April 2014
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Function ResolveByClassTextureRef returns the internal index, or name, of the texture assigned to the referenced object.
Primary, secondary, or tertiary texture assignments can be returned for objects that support multiple textures, such as roofs or walls. For objects that do not support multiple textures, pass 0 to the partID parameter.
Texture | Index Value |
---|---|
Primary | 0 |
Secondary | 1 |
Tertiary | 2 |
FUNCTION ResolveByClassTextureRef(
obj :HANDLE;
partID :INTEGER) : LONGINT;
def vs.ResolveByClassTextureRef(obj, partID): return LONGINT
Parameters
obj HANDLE Handle to object. partID INTEGER Primary, secondary, or tertiary texture ID to be returned.
Remarks
If the texture ref for an object is set to -1, it will use the texture of its class. This routine will look up the object's class and return the class' texture ref.
Julian Carr [25 April 2014]: I don't believe this works as described. If you create an extrude, put it in a class that has a texture applied in the Other tab, then run this code:
Message(ResolveByClassTextureRef(FSActLayer, -1));
it will only return a value if the selected extrude has the Texture popup set to Class Texture in the OIP. Otherwise it returns 0. It does not apply the class texture to the object
Example
VectorScript
textureID := ResolveByClassTextureRef(handleToObject, 0);
Python
Version
Availability: from VectorWorks 8.0
See Also
VS Functions:
VS:SetTextureRef | VS:GetTextureRef
[[VS:SetTextureRef]]
| [[VS:GetTextureRef]]