hi,
I see you trying to see your properties active from your object or tag plugin. Well just try to delete your (symbolcache file) and restart c4d and it will be fix.
lol I is run into this all the time when making NodeData Plugins.
cheers
hi,
I see you trying to see your properties active from your object or tag plugin. Well just try to delete your (symbolcache file) and restart c4d and it will be fix.
lol I is run into this all the time when making NodeData Plugins.
cheers
@m_magalhaes Thank you! and it makes sense. Heres a update of the code and Demo Video. And hope it helps anyone who might need this or was wondering how a simple Tool Data GUI works.
You see I just add the AddComboBox, AddEditText for testing also.
Code in .pyp file:
# // Imports for Cinema 4D //
import c4d
from c4d import plugins, gui, bitmaps, documents, storage, utils
import os
import sys
PLUGIN_ID = 1054512
def GetDataFromLinkBox(ui_ins, uiLinkID):
DATA = ui_ins.FindCustomGui(uiLinkID, c4d.CUSTOMGUI_LINKBOX).GetLink()
objDATA = DATA
objName = DATA.GetName()
objGUID = DATA.GetGUID()
return objDATA, objName, objGUID
def SetDataFromLinkBox(ui_ins, uiLinkID, Data):
LinkWidget = ui_ins.FindCustomGui(uiLinkID, c4d.CUSTOMGUI_LINKBOX)
LinkWidget.SetLink(Data)
return True
class DemoDialog(gui.SubDialog):
# Main Properties
UIDATA_PARAMETERS = {}
LinkBC = c4d.BaseContainer()
IDUI_CUSTOMGRP_LINK1 = 1003
IDUI_GRG_OBJ_GUID = 1004
MODE_MENU = 1005
MODE_MENU_LIST = {
"Mode 1":{'id':1, 'icon':"&i12298&"}, # (12298) # Model Icon Id (Eg:"&i12298&Model")
"Mode 2":{'id':2, 'icon':"&i12139&"}, # (12139) # Points Icon Id
"Mode 3":{'id':3, 'icon':"&i12187&"} # (12187) # Polygons Icon Id
}
def __init__(self, arg):
# Checks if the argument passed is a dictionary
if not isinstance(arg, dict):
raise TypeError("arg is not a dict.")
self.UIDATA_PARAMETERS = arg
def CreateLayout(self):
""" Window GUI elements layout that display to the User. """
ui = self
ui.GroupBegin(0, c4d.BFH_MASK, 2, 2, "", c4d.BFV_GRIDGROUP_EQUALCOLS)
ui.AddStaticText(0, c4d.BFH_RIGHT, 0, 12, "Object:", c4d.BORDER_WITH_TITLE_BOLD)
ui.AddCustomGui(ui.IDUI_CUSTOMGRP_LINK1, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_MASK, 240, 12, ui.LinkBC)
ui.AddStaticText(0, c4d.BFH_RIGHT, 0, 12, "Object GUID:", c4d.BORDER_WITH_TITLE_BOLD)
ui.AddEditText(ui.IDUI_GRG_OBJ_GUID, c4d.BFH_MASK, 240, 12)
ui.AddStaticText(0, c4d.BFH_RIGHT, 0, 12, "Modes:", c4d.BORDER_WITH_TITLE_BOLD)
ui.AddComboBox(ui.MODE_MENU, c4d.BFH_SCALEFIT, 100, 15, False)
for eachMode in sorted(ui.MODE_MENU_LIST):
itemMode = ui.MODE_MENU_LIST.get(str(eachMode))
ui.AddChild(ui.MODE_MENU, itemMode['id'], itemMode['icon']+str(eachMode))
ui.GroupEnd()
return True
def InitValues(self):
""" Called when the dialog is initialized by the GUI / GUI's startup values basically. """
SetDataFromLinkBox(ui_ins=self, uiLinkID=self.IDUI_CUSTOMGRP_LINK1, Data=self.UIDATA_PARAMETERS['grouplink'])
self.SetString(self.IDUI_GRG_OBJ_GUID, self.UIDATA_PARAMETERS['grouplinkGUID'])
self.SetLong(self.MODE_MENU, self.UIDATA_PARAMETERS['modeSelect'])
return True
def Command(self, id, msg):
""" Excuting Commands for UI Widget Elements Functions. """
if id == self.IDUI_CUSTOMGRP_LINK1:
obj, objName, objID = GetDataFromLinkBox(ui_ins=self, uiLinkID=self.IDUI_CUSTOMGRP_LINK1)
self.UIDATA_PARAMETERS['grouplink'] = obj
self.UIDATA_PARAMETERS['grouplinkGUID'] = objID
self.SetString(self.IDUI_GRG_OBJ_GUID, str(objID))
print("Linked Object:{0} | ID:{1} | GUI-ID:{2}").format( objName, objID, id )
if id == self.MODE_MENU:
for i in self.MODE_MENU_LIST:
getModeID = self.MODE_MENU_LIST.get(str(i))
if self.GetLong(self.MODE_MENU) == getModeID["id"]:
self.UIDATA_PARAMETERS['modeSelect']=getModeID["id"]
return True
class PyToolDemo(plugins.ToolData):
def __init__(self):
self.UI_DATA = { 'grouplink':None,
'grouplinkGUID':None,
'modeSelect':2 }
def GetState(self, doc):
if doc.GetMode()==c4d.Mpaint:
return 0
return c4d.CMD_ENABLED
def InitDefaultSettings(self, doc, data):
pass
def InitTool(self, doc, data, bt):
return True
def KeyboardInput(self, doc, data, bd, win, msg):
return True
def MouseInput(self, doc, data, bd, win, msg):
return True
def GetCursorInfo(self, doc, data, bd, x, y, bc):
return True
def AllocSubDialog(self, bc):
return DemoDialog(getattr(self, "UI_DATA", self.UI_DATA))
if __name__ == "__main__":
bmp = bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "tool_icon.tif")
bmp.InitWith(fn)
plugins.RegisterToolPlugin(id=PLUGIN_ID,
str="MyPyToolDemo",
info=0,
icon=bmp,
help="Your Data Staying ToolData UI",
dat=PyToolDemo())
User Information:
Cinema 4D Version: R19/R21;
Platform: Windows ;
Language(s) : Python ;
Hello Everyone!
This my first time making a tool data plugin. Now the problem is in R21 I drag the object into the link box and it don't stay and when I change the tool data or the settings dont stay , and i did this with other c4d gui widgets , eg: combobox, it just reset to the default value you set in the GeDialog.InitValues(). Now in R19 I drag the object into the link box and it stay but when I change the tool data or the settings dont stay.
You can see the short streamable videos below on what is happen inside C4D and take look at the code also. I hope there a easy fix for this problem and not a bug. lol
Inside R21: Video
Inside R19: Video
Code:
import c4d
from c4d import plugins, gui, bitmaps, documents, storage, utils
import os
import sys
PLUGIN_ID = 1054512
def GetDataFromLinkBox(ui_ins, uiLinkID):
DATA = ui_ins.FindCustomGui(uiLinkID, c4d.CUSTOMGUI_LINKBOX).GetLink()
objDATA = DATA
objName = DATA.GetName()
objGUID = DATA.GetGUID()
return objDATA, objName, objGUID
class DemoDialog(gui.SubDialog):
UIDATA_PARAMETERS = {}
LinkBC = c4d.BaseContainer()
IDUI_CUSTOMGRP_LINK1 = 1003
def __init__(self, arg):
# Checks if the argument passed is a dictionary
if not isinstance(arg, dict):
raise TypeError("arg is not a dict.")
self.UIDATA_PARAMETERS = arg
def CreateLayout(self):
ui = self
ui.GroupBegin(0, c4d.BFH_SCALEFIT, 2, 0, "")
ui.AddStaticText(0, c4d.BFH_RIGHT, 0, 12, "Object:", c4d.BORDER_WITH_TITLE_BOLD)
ui.AddCustomGui(ui.IDUI_CUSTOMGRP_LINK1, c4d.CUSTOMGUI_LINKBOX, "", c4d.BFH_MASK, 240, 12, ui.LinkBC)
ui.GroupEnd()
return True
def Command(self, id, msg):
if id == self.IDUI_CUSTOMGRP_LINK1:
obj, objName, objID = GetDataFromLinkBox(ui_ins=self, uiLinkID=self.IDUI_CUSTOMGRP_LINK1)
self.UIDATA_PARAMETERS['grouplink'] = obj
self.UIDATA_PARAMETERS['grouplinkGUID'] = objID
print("Linked Object:{0} | ID:{1} | GUI-ID:{2}").format( objName, objID, id )
return True
class ToolDemo(plugins.ToolData):
def __init__(self):
self.UI_DATA = { 'grouplink':None, 'grouplinkGUID':None }
def GetState(self, doc):
if doc.GetMode()==c4d.Mpaint:
return 0
return c4d.CMD_ENABLED
def InitDefaultSettings(self, doc, data):
pass
# expects None as return value
def InitTool(self, doc, data, bt):
return True
def KeyboardInput(self, doc, data, bd, win, msg):
return True
def MouseInput(self, doc, data, bd, win, msg):
return True
def GetCursorInfo(self, doc, data, bd, x, y, bc):
return True
def AllocSubDialog(self, bc):
return DemoDialog(getattr(self, "UI_DATA", self.UI_DATA))
if __name__ == "__main__":
bmp = bitmaps.BaseBitmap()
dir, file = os.path.split(__file__)
fn = os.path.join(dir, "res", "tool_icon.tif")
bmp.InitWith(fn)
plugins.RegisterToolPlugin(id=PLUGIN_ID,
str="MyPyToolDemo",
info=0,
icon=bmp,
help="Tool",
dat=ToolDemo())
And I am just wondering is c4d.plugins.SculptBrushToolData is better system than c4d.plugins.ToolData. Cause it look like description .res.. UI is for the tool plugin is more easy, like Node Data, Object Data Tags etc....
Any help would be very much appreciated.
cheers, Ashton
A little update on the node editor via Python small demo: Node Graph Editor via C4D Python API Video
I will share with the c4d py devs community when I'am done with this beast of a script.
Man thank you so much for all of your deep hard work and support, Sebastian. Best wishes for your new life chapter! and be safe. lol I still working on the node editor via Python small demo vid for you: Node Graph Editor via C4D Python API Video
I will share it with the c4d py devs community when I'am done.
@bentraje
Hope this will help you out its a small demo I did.
Quick video on how it look inside Cinema 4d. Here
Download Demo Test : GitHub Link
Code:
# Imports
import os
import sys
import c4d
from c4d import plugins, gui, bitmaps, documents, storage, utils
from c4d.gui import GeDialog as WindowDialog
from c4d.plugins import CommandData, TagData, ObjectData
iPath = os.path.join(os.path.dirname(__file__), 'res', "yourIcon.png")
def CustomCommandPopupMenu():
"""" Popup Commands Ids Only Menu """
menu = c4d.BaseContainer()
menu.InsData(0, '') # Append separator
menu.InsData(PLUG_2['ID'], "CMD") # eg: menu.InsData(00000000, "CMD")
menu.InsData(0, '') # Append separator
menu.InsData(PLUG_3['ID'], "CMD")
result = gui.ShowPopupDialog(cd=None, bc=menu, x=c4d.MOUSEPOS, y=c4d.MOUSEPOS)
return True
class CMDTool(CommandData):
def __init__(self, CMD):
super(CMDTool, self).__init__()
self.CMDTool = CMD
def Init(self, op):
return True
def Message(self, type, data):
return True
def Execute(self, doc):
if self.CMDTool == "PCT":
CustomCommandPopupMenu()
if self.CMDTool == "PCT1":
gui.MessageDialog("PlugCafeTool2")
if self.CMDTool == "PCT2":
gui.MessageDialog("PlugCafeTool2")
def RestoreLayout(self, sec_ref):
return True
def ExecuteOptionID(self, doc, plugid, subid):
gui.MessageDialog("PlugCafeTool2 Options")
return True
# ----------------------------------------------------
# Plugin Registration
# ----------------------------------------------------
# // Plugin Flags Tpyes //
class PluginFlags:
""" Register Info Plugin Flags Tpyes """
# Plugin General Flags :
HidePlugin = c4d.PLUGINFLAG_HIDE
HideTool = c4d.PLUGINFLAG_HIDEPLUGINMENU
RefreshPlugin = c4d.PLUGINFLAG_REFRESHALWAYS
SmallNodePlugin = c4d.PLUGINFLAG_SMALLNODE
# Command Plugin Flags:
OptionGear = c4d.PLUGINFLAG_COMMAND_OPTION_DIALOG # A info flag / Command has additional options. The user can access them through a small gadget.
# Tag Plugin Flags :
TagVis = c4d.TAG_VISIBLE # The tag can be seen in the object manager.
TagMul = c4d.TAG_MULTIPLE # Multiple copies of the tag allowed on a single object.
TagHier = c4d.TAG_HIERARCHICAL # The tag works hierarchical, so that sub-objects inherit its properties (e.g. the material tag).
TagExp = c4d.TAG_EXPRESSION # The tag is an expression.
TagTem = c4d.TAG_TEMPORARY # Private.
# Object Plugin Flags:
oMod = c4d.OBJECT_MODIFIER # Modifier object. Deforms the surrounding object. (E.g. bend.)
oHier = c4d.OBJECT_HIERARCHYMODIFIER # Hierarchical modifier. Deforms the surrounding objects together with other instances in a hierarchy chain. Only the top-most instance of the plugin in a chain is called. (E.g. bones.)Hierarchical modifier. Deforms the surrounding objects together with other instances in a hierarchy chain. Only the top-most instance of the plugin in a chain is called. (E.g. bones.)
oGen = c4d.OBJECT_GENERATOR # Generator object. Produces a polygonal or spline representation on its own. (E.g. primitive cube.)
oInput = c4d.OBJECT_INPUT # Used in combination with OBJECT_GENERATOR. Specifies that the generator uses builds a polygon or spline, using its subobjects as input. (E.g. Sweep Subdivision Surface, Boolean.)
oPart = c4d.OBJECT_PARTICLEMODIFIER # Particle modifier.
oSpline = c4d.OBJECT_ISSPLINE # The object is a spline.
oCamera = c4d.OBJECT_CAMERADEPENDENT # Camera dependent.
oPointObj = c4d.OBJECT_POINTOBJECT # Point Object.
oPolyObj = c4d.OBJECT_POLYGONOBJECT # Polygon object.
PF = PluginFlags()
# // Register Plugin Add-on Tool Tpyes to Cinema 4D //
def RegisterCommandData(id, str_name, infoflags, iconName, helpInfo, dataClass):
""" A CommandData Tool Plugin Register """
DESCRIPTIONS = "" #ToolInfo_Description(helpInfo)
plugin_Icon = c4d.bitmaps.BaseBitmap()
plugin_Icon.InitWith(iconName)
result = plugins.RegisterCommandPlugin(id=id, # Plugin register ID.
str=str_name, # This is for the Plugin Name to show in the Plugins lic4d.storage.
info=infoflags, # If you want a option button once you have a ExecuteOptionID in Data Class,
# then put in Flags info=c4d.PLUGINFLAG_COMMAND_OPTION_DIALOG|c4d.PLUGINFLAG_COMMAND_HOTKEY,
icon=plugin_Icon, # Plugin Icon Image.
help=DESCRIPTIONS, # The plugin help info is on what the plugin does.
dat=dataClass) # The plugin data class.
return True
# // Register Tools //
PLUG_1 = {'ID':1050002, 'Icon':iPath, 'Name':"CommandTools Menu",'flags':0, 'Data':CMDTool("PCT"), 'Info':""}
PLUG_2 = {'ID':1051421, 'Icon':iPath, 'Name':"PlugCafeTool-1", 'flags':PF.HideTool, 'Data':CMDTool("PCT1"), 'Info':""}
PLUG_3 = {'ID':1054336, 'Icon':iPath, 'Name':"PlugCafeTool-2", 'flags':PF.HideTool|PF.OptionGear, 'Data':CMDTool("PCT2"), 'Info':""}
if __name__ == '__main__':
dir, file = os.path.split(__file__)
RegisterCommandData(PLUG_1["ID"], PLUG_1["Name"], PLUG_1["flags"], PLUG_1["Icon"], PLUG_1["Info"], PLUG_1["Data"])
RegisterCommandData(PLUG_2["ID"], PLUG_2["Name"], PLUG_2["flags"], PLUG_2["Icon"], PLUG_2["Info"], PLUG_2["Data"])
RegisterCommandData(PLUG_3["ID"], PLUG_3["Name"], PLUG_3["flags"], PLUG_3["Icon"], PLUG_3["Info"], PLUG_3["Data"])
cheers & good luck!
Ap Ashton
I just wanted to shared this with you y'all and for anyone who might need this.
This Cinema 4D script allow you to see how a c4d.CUSTOMGUI_INEXCLUDE_LIST and c4d.CUSTOMGUI_PROGRESSBAR gui works. And this will also show, you can change or set the process bar color and other ui colors too.
Quick video on how it works!
GitHub Link
Cheers!
ApAshton
@BigRoy Hi and I am not to sure what you are asking for, but I hope this help you out, I didn't had time to type out a quick code but I hope these pics below help you.
Now from what I know, you have to make a command plugin with a ID to add to your tool to the custom menu.
So basically you need to make it a plugin so c4d can call or load your custom menu that is the (PluginMessage()) when the plugin is loaded. For scripts that's a no.
These are how my studio tools menu look in c4d :
This when you press V key button and the c4d pipe menu comes up :
The code in your .pyp file :
Cheers!
If you anymore questions free to contact me I don't mine helping in the best way I can.
Fackbook: https://www.facebook.com/ap.base.1
Email: [email protected]
@s_bach Okay I will give it a try , and I will do a open source example project for anyone, who would love to do this with python only for Cinema 4D. lol I been making different types c4d python plugins for 3 years now, from 2015 for my studio I work for and I love making c4d plugins. But this will be my first time using GeUserArea Class to the fullest lol.
@s_bach Okay I look at that tread, So pyQt is out of the window sense it's not good to use or wont work the right way and maxon is not going to add it or support it and don't do it for a commercial plugin, The only way is using c4d.gui.GeUserArea (GeUserArea) like Octane Node Graph and cmNodes. It will just be alot of work, when doing this with GeUserArea. I just want make sure I'm understanding everything correctly?
@s_bach Hi s_bach Is there another way of making a custom node graph editor via python? Cause I dont know c++ , so any tip can be great.
User Information:
Cinema 4D Version: R19;
Platform: Windows ;
Language(s) : Python ;
Hello Everyone!
Its been a while I have not post anything. Well I have been getting an error on attaching a xpresso node graph to a gui manual
dialog. I don't know or understand why its not working but hope y'all can he me.
Code:
self.GroupBegin(self.ID_GRP, c4d.BFH_SCALEFIT, 1, 0, "")
# Static UI Text
self.AddStaticText(0, c4d.BFH_CENTER, 0, 15, "Node Editor", c4d.BORDER_WITH_TITLE_BOLD)
# Get Active Document
doc = c4d.documents.GetActiveDocument()
if doc == None:
return False
# Search for the Object in the (Objects) List Manger Hierarchy Outliner Tab.
getnodeobj = doc.SearchObject("node")
if getnodeobj == None:
return ValueError("Make sure the selected object.")
# Retrieves the Xpresso Tag
graphtag = getnodeobj.GetTag(c4d.Texpresso)
if graphtag is None:
raise ValueError("Make sure the selected object get an Xpresso Tag.")
else:
# Set Xpresso Tag Name
graphtag[c4d.ID_BASELIST_NAME]="Custom Node Graph Editor"
print(graphtag)
"""
Retrieves the node master and retrieves the Root node (the Main XGroup)
that holds all others nodes and set name of (the Main XGroup)
"""
gvNodeMaster = graphtag.GetNodeMaster()
if gvNodeMaster is None:
raise RuntimeError("Failed to retrieves the Node Master.")
else:
nodegraph_root_group = gvNodeMaster.GetRoot()
if nodegraph_root_group is None:
raise RuntimeError("Failed to retrieves the Root Node.")
else:
# Set the Main XGroup Name
nodegraph_root_group[c4d.ID_BASELIST_NAME]="Tool Node Editor"
print(nodegraph_root_group)
# Add to UI
self.AddUserArea(self.ID_NODE_VIEWPORT, c4d.BFH_CENTER, 350, 200)
self.AttachUserArea(gvNodeMaster, self.ID_NODE_VIEWPORT)
self.GroupEnd()
Error in Console:
But if there is another way of making a custom node graph editor via python , I would love to know.
Any help would be very much appreciated.
cheers, Ashton
For anyone who would like to use or learn from the script. You can download full script from github. ( Get And Copy Textures From Texture Tags )
Thank you m_adam! And for the advice.
Everything works fine, and no error.
But Maxon needs to add some of the C++ api sdk to the python api sdk. Cause I had to research for the (REFLECTION_LAYER types ) and they was in c++ sdk so I hope maxon think about this, cause it a lot of up and down lol.
The fix and working code:
# Get Reflection or Spec map texture from the Reflectance Channel.
m_spec = userMat.GetReflectionLayerCount()
for each_layer in xrange(0, m_spec):
getlayer = userMat.GetReflectionLayerIndex(each_layer)
get_spec = userMat[getlayer.GetDataID() + c4d.REFLECTION_LAYER_COLOR_TEXTURE]
if not get_spec or get_spec.CheckType(c4d.Xbitmap):
print " No bitmap apply in this channel. "
pass
else:
show_loc_path_Spec = get_spec[c4d.BITMAPSHADER_FILENAME]
print show_loc_path_Spec
For anyone who would like to use or learn from the script. You can download full script from github. ( Get And Copy Textures From Texture Tags )
Thanks again and Cheers,
Ashton,
Love new plugincafe forum!
Hello guys,
It's been a while guys hope y'all okay.
I working on a small script, on getting all texture tags on object & show texture paths by printing out to the c4d console.
But the reflection channel throw error when I enable the code to run, It's like it don't want me to get the texture path.
CODE:
import c4d, os, shutil
from c4d import plugins, gui, bitmaps, documents, storage
from os import path as p
#Welcome to the world of Python
def CopyPath_To_Path(path, tex_path, pastefolder):
if ":\\" not in path:
# Is in tex.
Tex_path = tex_path + "\\tex\\" + path
shutil.copy2(Tex_path, pastefolder)
print Tex_path
else:
# Not in tex.
shutil.copy2(path, pastefolder)
print path
return True
def main():
desk_folder = storage.GeGetC4DPath(c4d.C4D_PATH_DESKTOP)
folder = os.path.join(desk_folder, "CopyTextures")
if not p.exists(folder):
os.mkdir(folder)
doc = c4d.documents.GetActiveDocument()
if doc == None:
return False
# Get Objects form the Object Manager
list_objs = doc.GetActiveObjects(1)
if not list_objs:
gui.MessageDialog("Select an Object!")
return
for E in list_objs:
doc = c4d.documents.GetActiveDocument()
ProjectTexPath = doc.GetDocumentPath()
object_Tags = E.GetTags()
for each_c4d_tag in object_Tags:
if each_c4d_tag.CheckType(c4d.Ttexture):
get_t = each_c4d_tag[c4d.TEXTURETAG_MATERIAL]
makstr = str(get_t)
# Get string by spliting a long string up.
str_1 = makstr.split("'")[1]
finalstr = str_1.split('/')[0]
# Material Name
MatName = finalstr
# Find Material
GetMat = doc.SearchMaterial(MatName)
# Get Material
userMat = doc.GetActiveMaterial()
# Get Material Shaders Texture Paths.
m_color = userMat[c4d.MATERIAL_COLOR_SHADER]
show_loc_path_Diff = m_color[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_Diff, tex_path=ProjectTexPath, pastefolder=folder)
m_alpha = userMat[c4d.MATERIAL_ALPHA_SHADER]
show_loc_path_Alpha = m_alpha[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_Alpha, tex_path=ProjectTexPath, pastefolder=folder)
m_diffusion = userMat[c4d.MATERIAL_DIFFUSION_SHADER]
show_loc_path_diff = m_diffusion[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_diff, tex_path=ProjectTexPath, pastefolder=folder)
m_lum = userMat[c4d.MATERIAL_LUMINANCE_SHADER]
show_loc_path_LM = m_lum[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_LM, tex_path=ProjectTexPath, pastefolder=folder)
m_nor = userMat[c4d.MATERIAL_NORMAL_SHADER]
show_loc_path_Nor = m_nor[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_Nor, tex_path=ProjectTexPath, pastefolder=folder)
m_trans = userMat[c4d.MATERIAL_TRANSPARENCY_SHADER]
show_loc_path_Trans = m_trans[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_Trans, tex_path=ProjectTexPath, pastefolder=folder)
m_enviro = userMat[c4d.MATERIAL_ENVIRONMENT_SHADER]
show_loc_path_enviro = m_enviro[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_enviro, tex_path=ProjectTexPath, pastefolder=folder)
m_bump = userMat[c4d.MATERIAL_BUMP_SHADER]
show_loc_path_bump = m_bump[c4d.BITMAPSHADER_FILENAME]
CopyPath_To_Path(path=show_loc_path_bump, tex_path=ProjectTexPath, pastefolder=folder)
#----------------------------------------------------------------#
# THE PROBLEM HERE WHEN I ENABLE IT.
#m_spec = userMat[c4d.MATERIAL_REFLECTION_SHADER]
#show_loc_path_Spec = m_spec[c4d.BITMAPSHADER_FILENAME]
#print show_loc_path_Spec
#----------------------------------------------------------------#
c4d.EventAdd()
if __name__=='__main__':
main()
Error in the Console:
TypeError: 'NoneType' object has no attribute 'getitem'
tips on this would be great.
cheers,
Ashton