Cool addition that finally we can set active SF by name, makes .bats much more timeproof and understanable
-SET_ACTIVE_SF {SF index or 'SF name'}
my request would be that if no index is provided, this command would remove the current SF instead of a warning, and warning only would display if no SF is active.
form the docs:
-REMOVE_SF {index} Removes the scalar field at the specified index (from all loaded clouds or meshes).
Notes:
if no SF is found at this index, a simple warning will be issued (no error will be triggered).
entities are not automatically saved after this command (you can use -SAVE_CLOUDS or -SAVE_MESHES explicitly)
since version 2.12
EDIT: Also, ir provided string SF does not exist, not sure what will happen, but not crash the loop but print a warning, I would say.
-REMOVE_SF no index, delete current SF if any
-
- Posts: 290
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
I totally get where you're coming from with the -SET_ACTIVE_SF command. It's really handy to be able to set the active Scalar Field (SF) by name – definitely a time-saver and makes scripts more readable. Your suggestion about the default behavior of removing the current SF if no index is specified seems like a logical step. It would streamline processes, especially in batch operations. Also, a warning for non-existent SFs instead of crashing the loop is a smart fail-safe. It's these little quality-of-life improvements that can make a big difference in usability. Looking forward to seeing how this evolves! A spreadsheet template is a pre-designed layout for a spreadsheet application like Microsoft Excel, Google Sheets, or similar programs.Business expense spreadsheet templates cater to the needs of different types and sizes of businesses. They are suitable for both small businesses that need a simple and efficient tool to track everyday expenses, and larger companies that require a more detailed record of their spending.
Last edited by alemx921 on Mon Jan 01, 2024 7:01 pm, edited 1 time in total.
Re: -REMOVE_SF no index, delete current SF if any
So it's hard to detect that no argument was provided (unless it's the very last command of course). So I would prefer something like
-SET_ACTIVE_SF -1 (-1 is the internal representation of 'no active SF').
-SET_ACTIVE_SF -1 (-1 is the internal representation of 'no active SF').
Daniel, CloudCompare admin
-
- Posts: 290
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
I guess it is a missap, but I was referring to the -REMOVE_SF commando not the -SET_ACTIVE_SF one when requesting to not to provice index, meaning having alread activated by string an SF, to be able to remove the one that is current, simply by no having to input the index.
If by using -1 we could reffer to the active SF, to me that would be a good solution.
If not, adding string support to the -REMOVE_SF would be ok also, abit more bloaty tho.
Re: -REMOVE_SF no index, delete current SF if any
Ah ok. I'll try to get back at it later.
Daniel, CloudCompare admin
Re: -REMOVE_SF no index, delete current SF if any
Ok, so now the current/default active scalar field can be designated by '-1' with the following commands:
- REMOVE_SF
- SF_TO_COORD
- SF_ARITHMETIC
- SF_OP
- SF_INTERP
- RENAME_SF
- ICP (USE_MODEL_SF_AS_WEIGHT/USE_DATA_SF_AS_WEIGHT)
Daniel, CloudCompare admin
-
- Posts: 290
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
superb! thank you so much!
-
- Posts: 290
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
PLEASE DELETE, I'M STUPID, THE ISSUE WAS THE CAPS.
***********************************************
Hi,
Thanks for the addition, yet I think something is not working properly.
It seems like the single character SF are properly set up as current and removed when using -Remove -1
But with "Alpha" "Composite" fields it says it does not exist while they do :\
Check attached img.
https://drive.google.com/file/d/1QNnB48 ... sp=sharing[
I've tested in other scripts so set the SF by name, like Classification, without issues. So the problem must be in the -Remove method. Also notice how the index SF index is none, even in the SF of single character. That may be related to the issue as-Remove may be removing based on the active index, despite the user input is done by name.
EDIT:
notice also, an small thing in the log is that when saving it seems like the mapping for the removed SF is still there and logs an small err as the SF is no longer, may be upon rmoval, the mapping of the SF should be flushed. Or may be not, just point this out.
.bat
for %%f in (E:\LIDAR_JAPAN\MMS_14_Prototype_4\MMS\03_Off_GroundClean\*.las) DO "C:\Program Files\CloudCompare\cloudcompare.exe" -SILENT -O -GLOBAL_SHIFT AUTO %%f -AUTO_SAVE OFF -C_EXPORT_FMT LAS -NO_TIMESTAMP -SET_ACTIVE_SF R -REMOVE_SF -1 -SET_ACTIVE_SF G -REMOVE_SF -1 -SET_ACTIVE_SF B -REMOVE_SF -1 -SET_ACTIVE_SF 'ALPHA' -REMOVE_SF -1 -SET_ACTIVE_SF 'COMPOSITE' -REMOVE_SF -1 -SAVE_CLOUDS
***********************************************
Hi,
Thanks for the addition, yet I think something is not working properly.
It seems like the single character SF are properly set up as current and removed when using -Remove -1
But with "Alpha" "Composite" fields it says it does not exist while they do :\
Check attached img.
https://drive.google.com/file/d/1QNnB48 ... sp=sharing[
I've tested in other scripts so set the SF by name, like Classification, without issues. So the problem must be in the -Remove method. Also notice how the index SF index is none, even in the SF of single character. That may be related to the issue as-Remove may be removing based on the active index, despite the user input is done by name.
EDIT:
notice also, an small thing in the log is that when saving it seems like the mapping for the removed SF is still there and logs an small err as the SF is no longer, may be upon rmoval, the mapping of the SF should be flushed. Or may be not, just point this out.
.bat
for %%f in (E:\LIDAR_JAPAN\MMS_14_Prototype_4\MMS\03_Off_GroundClean\*.las) DO "C:\Program Files\CloudCompare\cloudcompare.exe" -SILENT -O -GLOBAL_SHIFT AUTO %%f -AUTO_SAVE OFF -C_EXPORT_FMT LAS -NO_TIMESTAMP -SET_ACTIVE_SF R -REMOVE_SF -1 -SET_ACTIVE_SF G -REMOVE_SF -1 -SET_ACTIVE_SF B -REMOVE_SF -1 -SET_ACTIVE_SF 'ALPHA' -REMOVE_SF -1 -SET_ACTIVE_SF 'COMPOSITE' -REMOVE_SF -1 -SAVE_CLOUDS
Last edited by PablerasBCN on Mon May 20, 2024 10:16 pm, edited 1 time in total.
-
- Posts: 290
- Joined: Sat Jan 20, 2018 1:57 pm
Re: -REMOVE_SF no index, delete current SF if any
CONSIDER DELETING MY LAST 2 POST, IT WAS THE CAPS! SORRY !
*****************************
I was reading the post, I think I may be stuppid.
The string in the bat is in CAPS... will edit if that was the case
*****************************
I was reading the post, I think I may be stuppid.
The string in the bat is in CAPS... will edit if that was the case