Is there a way to unset a custom color property?
With other properties you can just delete them and they won't be exported but once I've set a color, I can't see anyway to unset it.
Cheers.
Unset custom color property
Re: Unset custom color property
This might help:
viewtopic.php?f=7&t=457
viewtopic.php?f=7&t=457
Re: Unset custom color property
ah, if you mean just using the GUI.... nope.
Setting the color to white with full opacity will have the same effect though.
Setting the color to white with full opacity will have the same effect though.
Re: Unset custom color property
Sorry I did search for "unset custom color property" beforehand but only checked the discussion forum and got no results.
I did mean in the gui, but that's ok, the code you pointed to worked. Thanks.
The reason I want to clear them is so they don't get exported into my json as it's wasted space, and just setting the color to white doesn't stop it being exported.
I did mean in the gui, but that's ok, the code you pointed to worked. Thanks.
The reason I want to clear them is so they don't get exported into my json as it's wasted space, and just setting the color to white doesn't stop it being exported.
Re: Unset custom color property
Yeah I figured that was what you were trying to do. Another way to handle it would be with a property export filter, to look at the color values and ignore any default color properties:
You can see some explanation of setting up these filters here: RUBE editor v1.5 updates
or search for 'export filter' in the built-in help.
Code: Select all
bool shouldExportProperty( body b, const string& in propertyName ) {
if ( b.getCustomPropertyType( propertyName ) == 'color' ) {
color c = b.getCustomColor( propertyName );
if ( c.r + c.g + c.b + c.a == 4 )
return false;
}
return true;
}
or search for 'export filter' in the built-in help.