Skip to content
Open
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class BMNFTS_PGT_MyProperties(bpy.types.PropertyGroup):

# ERC721 Custom Metadata Fields
erc721_description: bpy.props.StringProperty(name="ERC721 description")
erc721_ipfs: bpy.props.StringProperty(name="ERC721 IPFS")


def make_directories(save_path):
Expand Down Expand Up @@ -250,6 +251,16 @@ class refactor_panel_input:
cardano_description = bpy.context.scene.my_tool.cardano_description
solana_description = bpy.context.scene.my_tool.solana_description
erc721_description = bpy.context.scene.my_tool.erc721_description
erc721_ipfs = bpy.context.scene.my_tool.erc721_ipfs

enableImages = bpy.context.scene.my_tool.imageBool
imageFileFormat = bpy.context.scene.my_tool.imageEnum

enableAnimations = bpy.context.scene.my_tool.animationBool
animationFileFormat = bpy.context.scene.my_tool.animationEnum

enableModelsBlender = bpy.context.scene.my_tool.modelBool
modelFileFormat = bpy.context.scene.my_tool.modelEnum

Blend_My_NFTs_Output, batch_json_save_path, nftBatch_save_path = make_directories(save_path)

Expand Down Expand Up @@ -381,6 +392,8 @@ def draw(self, context):
if bpy.context.scene.my_tool.erc721MetaData:
row = layout.row()
row.prop(mytool, "erc721_description")
row = layout.row()
row.prop(mytool, "erc721_ipfs")

row = layout.row()
row.operator("wm.url_open", text="ERC721 Metadata Documentation",
Expand Down
4 changes: 2 additions & 2 deletions main/Metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def returnSolanaMetaData(name, NFT_DNA, NFT_Variants, custom_Fields_File, enable
return metaDataDictSolana

# ERC721 Template
def returnErc721MetaData(name, NFT_DNA, NFT_Variants, custom_Fields_File, enableCustomFields, erc721_description):
def returnErc721MetaData(name, NFT_DNA, NFT_Variants, custom_Fields_File, enableCustomFields, erc721_description, erc721IpfsUrl):
metaDataDictErc721 = {
"name": name,
"description": erc721_description,
"image": "",
"image": erc721IpfsUrl,
"attributes": None,
}

Expand Down
20 changes: 18 additions & 2 deletions main/Refactorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,18 @@ def renameMetaData(rename_MetaData_Variables):
if not os.path.exists(erc721MetaDataPath):
os.mkdir(erc721MetaDataPath)

if rename_MetaData_Variables.enableImages == True:
ipfsFileType = rename_MetaData_Variables.imageFileFormat
if rename_MetaData_Variables.enableAnimations == True:
ipfsFileType = rename_MetaData_Variables.animationFileFormat
if rename_MetaData_Variables.enableModelsBlender == True:
ipfsFileType = rename_MetaData_Variables.modelFileFormat

erc721JsonNew = "Erc721_" + i
erc721NewName = name.split("_")[0] + "_" + str(file_num)

metaDataDictErc721 = Metadata.returnErc721MetaData(erc721NewName, NFT_DNA, NFT_Variants, rename_MetaData_Variables.custom_Fields_File, rename_MetaData_Variables.enableCustomFields, rename_MetaData_Variables.erc721_description)
erc721IpfsUrl = "ipfs://" + rename_MetaData_Variables.erc721_ipfs + "/" + erc721NewName + "." + ipfsFileType.lower()

metaDataDictErc721 = Metadata.returnErc721MetaData(erc721NewName, NFT_DNA, NFT_Variants, rename_MetaData_Variables.custom_Fields_File, rename_MetaData_Variables.enableCustomFields, rename_MetaData_Variables.erc721_description, erc721IpfsUrl)

sendMetaDataToJson(metaDataDictErc721, erc721MetaDataPath, erc721JsonNew)
return
Expand Down Expand Up @@ -216,6 +224,13 @@ def reformatNFTCollection(refactor_panel_input):
class rename_MetaData_Variables:
completeCollPath = completeCollPath
completeMetaDataPath = completeMetaDataPath

enableImages = refactor_panel_input.enableImages
imageFileFormat = refactor_panel_input.imageFileFormat
enableAnimations = refactor_panel_input.enableAnimations
animationFileFormat = refactor_panel_input.animationFileFormat
enableModelsBlender = refactor_panel_input.enableModelsBlender
modelFileFormat = refactor_panel_input.modelFileFormat

cardanoMetaDataBool = refactor_panel_input.cardanoMetaDataBool
solanaMetaDataBool = refactor_panel_input.solanaMetaDataBool
Expand All @@ -228,6 +243,7 @@ class rename_MetaData_Variables:
cardano_description = refactor_panel_input.cardano_description
solana_description = refactor_panel_input.solana_description
erc721_description = refactor_panel_input.erc721_description
erc721_ipfs = refactor_panel_input.erc721_ipfs


renameMetaData(rename_MetaData_Variables)
Expand Down