VS:GetTexMapBoolN: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
(expand info, add example) |
||
Line 46: | Line 46: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark></remark> | <remark>([[User:Orso.b.schmid|Orso]], 2017 Dec. 29) The number of layers of a part can be fetched using [[VS:GetNumTexLayers]]. If a part is in usage it has one layer, so its texLayerID = 1. If the part has additional layers for decals the part's layers will be more than 1. | ||
texPartID flags: | |||
: 3: overall for any kind of object | |||
: 4: | |||
: 5: | |||
: 6: | |||
: 7: left in walls | |||
: 8: right in walls | |||
: 9: start cap in walls | |||
: 10: end cap in walls | |||
: 11: top in walls | |||
: 12: bottom in walls | |||
: 13: holes in walls | |||
: 14: top in roofs/slabs | |||
: 15: bottom in roofs/slabs | |||
: 16: sides in roofs/slabs | |||
* An extrude will only respond to texPartID 3 | |||
* A roof or a slab responds to texPartID 3 and 14-16 | |||
* A wall can respond to texPartID 3 up to 15, whereby I don't know what 14 and 15 are for walls. | |||
</remark> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample></sample> | <sample> | ||
<code lang="pas">PROCEDURE TEST; | |||
VAR | |||
obj: HANDLE; | |||
texPartID : INTEGER; | |||
BEGIN | |||
obj := FSActLayer; | |||
texPartID := 3; { overall } | |||
IF (obj <> NIL) THEN | |||
AlrtDialog(Concat('Is the last layer of the overall part auto-aligned?', Chr(13), | |||
GetTexMapBoolN(obj, texPartID, GetNumTexLayers(obj, texPartID), 7) { flag 7 = Auto-align } | |||
)) | |||
ELSE | |||
AlrtDialog('Please select a textured object'); | |||
END; | |||
RUN(TEST)</code>; | |||
</sample> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Revision as of 11:54, 29 December 2017
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Get map info for specific part of object. partID is texture part, overall is 3. Selector: init:1, flip:2, repH:3, repV:4, long edge:5, worldZ:6, auto align:7
FUNCTION GetTexMapBoolN(
obj :HANDLE;
texPartID :LONGINT;
texLayerID :LONGINT;
selector :INTEGER) : BOOLEAN;
def vs.GetTexMapBoolN(obj, texPartID, texLayerID, selector): return BOOLEAN
Parameters
obj HANDLE texPartID LONGINT texLayerID LONGINT 0 for base, >0 for decals selector INTEGER
Remarks
(Orso, 2017 Dec. 29) The number of layers of a part can be fetched using VS:GetNumTexLayers. If a part is in usage it has one layer, so its texLayerID = 1. If the part has additional layers for decals the part's layers will be more than 1.
texPartID flags:
- 3: overall for any kind of object
- 4:
- 5:
- 6:
- 7: left in walls
- 8: right in walls
- 9: start cap in walls
- 10: end cap in walls
- 11: top in walls
- 12: bottom in walls
- 13: holes in walls
- 14: top in roofs/slabs
- 15: bottom in roofs/slabs
- 16: sides in roofs/slabs
- An extrude will only respond to texPartID 3
- A roof or a slab responds to texPartID 3 and 14-16
- A wall can respond to texPartID 3 up to 15, whereby I don't know what 14 and 15 are for walls.
Example
PROCEDURE TEST; VAR obj: HANDLE; texPartID : INTEGER; BEGIN obj := FSActLayer; texPartID := 3; { overall } IF (obj <> NIL) THEN AlrtDialog(Concat('Is the last layer of the overall part auto-aligned?', Chr(13), GetTexMapBoolN(obj, texPartID, GetNumTexLayers(obj, texPartID), 7) { flag 7 = Auto-align } )) ELSE AlrtDialog('Please select a textured object'); END; RUN(TEST)
Version
Availability: from Vectorworks 2010