Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New layer option: noLayerMeta #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ const layersSetup = (layersOrder) => {
layerObj.options?.["bypassDNA"] !== undefined
? layerObj.options?.["bypassDNA"]
: false,
noLayerMeta:
layerObj.options?.["noLayerMeta"] !== undefined
? layerObj.options?.["noLayerMeta"]
: false,
}));
return layers;
};
Expand Down Expand Up @@ -182,17 +186,23 @@ const addMetadata = (_dna, _edition) => {

const addAttributes = (_element) => {
let selectedElement = _element.layer.selectedElement;
let ignore = false;

console.log("Debug - noLayerMeta: " + _element.layer.noLayerMeta);
if (_element.layer.noLayerMeta !== undefined && _element.layer.noLayerMeta) {
ignore = true;
}

//Added ability for user to state whether they are using blank images or blank keyword within image names so that the code can already cater for it as the norm is to remove blanks from attribute lists.
if (NFT_DETAILS.ignoreAllNamesWithBlank) {
if (!selectedElement.name.trim().toLowerCase().includes("blank")) {
addToAttrbutesList(_element.layer.name, selectedElement.name);
}
} else if (NFT_DETAILS.ignoreExactBlankName) {
if (selectedElement.name.trim().toLowerCase() !== "blank") {
addToAttrbutesList(_element.layer.name, selectedElement.name);
}
} else {
if (NFT_DETAILS.ignoreAllNamesWithBlank && selectedElement.name.trim().toLowerCase().includes("blank")) {
ignore = true;
}

if (NFT_DETAILS.ignoreExactBlankName && selectedElement.name.trim().toLowerCase() === "blank") {
ignore = true;
}

if (!ignore) {
addToAttrbutesList(_element.layer.name, selectedElement.name);
}
};
Expand Down Expand Up @@ -254,6 +264,7 @@ const constructLayerToDna = (_dna = "", _layers = []) => {
name: layer.name,
blend: layer.blend,
opacity: layer.opacity,
noLayerMeta: layer.noLayerMeta,
selectedElement: selectedElement,
};
});
Expand Down Expand Up @@ -324,7 +335,8 @@ const selectTraits = (layers) => {
name: layer.elements[i].name,
filename: layer.elements[i].filename,
bypassDNA: layer.bypassDNA,
maxRepeatedTrait: layer.maxRepeatedTrait
maxRepeatedTrait: layer.maxRepeatedTrait,
noLayerMeta: layer.noLayerMeta,
},
);
}
Expand Down