e5b1b4457f
- migliorata la gestione dei colori ( rimozione passaggi con esadecimali) - aggiunta la funzione di Undo per le curve di sincronizzazione per interpolazione.
42 lines
1.5 KiB
Lua
42 lines
1.5 KiB
Lua
-- ResetInterpSyncLines.lua by Egalware s.r.l. 2026/02/23
|
|
|
|
require( 'EgtBase')
|
|
_ENV = EgtProtectGlobal()
|
|
EgtEnableDebug( false)
|
|
|
|
-- Carico le costanti di Trimming
|
|
EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
|
|
local GlobVar = require( 'TrimmingLib')
|
|
-- Costante di Errore
|
|
local ERROR_EDIT_SYNC_CURVES = 'Error in Edit Sync Curves : '
|
|
|
|
-- Recupero il Part e Layer di Trimming corrente
|
|
local nCurrPartId = EgtGetCurrPart()
|
|
local nCurrLayerId = EgtGetCurrLayer()
|
|
local nTrimmingLayer = GlobVar.GetTrimmingLayerRefId( nCurrLayerId)
|
|
if not nTrimmingLayer or nTrimmingLayer == GDB_ID.NULL then
|
|
EgtOutBox( ERROR_EDIT_SYNC_CURVES .. 'Not a valid Trimming Layer', 'Error', 'ERROR', 'OK')
|
|
return
|
|
end
|
|
|
|
-- Recupero il Layer di Edit
|
|
local nLayerEditId = GlobVar.GetCurrentEditSyncCurvesLayer( nCurrPartId, nTrimmingLayer)
|
|
if ( not nLayerEditId or nLayerEditId == GDB_ID.NULL) then
|
|
EgtOutBox( ERROR_EDIT_SYNC_CURVES .. 'Not a valid Edit mode created', 'Error', 'ERROR', 'OK')
|
|
return
|
|
end
|
|
|
|
-- Chiedo all'Utente la conferma dell'operazione
|
|
local bRemove = EgtOutBox( 'Do you want to remove the last Interpolated Sync Lines ?', 'Deleting', 'QUESTION', 'YESNO')
|
|
if not bRemove then return end
|
|
|
|
-- Recupero le ultime Linee di Sincronizzazione aggiunte e le elimino
|
|
local vLastSurfIds = EgtGetInfo( nLayerEditId, KEY_SYNC_LINES_INTERPOLATION_IDS, 'vi')
|
|
if vLastSurfIds ~= nil and #vLastSurfIds ~= 0 then EgtErase( vLastSurfIds) end
|
|
|
|
-- Metto il focus sul Layer di Edit delle curve di Sincronizzazione
|
|
EgtSetCurrPartLayer( nCurrPartId, nLayerEditId)
|
|
|
|
-- Aggiorno la grafica
|
|
EgtDraw()
|