Perfect! Thank you so much!
Posts made by visualride
I'm writing a plugin to change the bitmaps within layered shaders. I've found here some great examples on how to change parameters in LayerShaderLayer but have yet to figure out exactly how to change and update a bitmap in the layered shader.
Here's my latest attempt. I know that I probably don't have to update all elements, but to be sure, I updated a few.
mat = doc.GetFirstMaterial()
shd = mat.GetFirstShader()
if shd.GetName() == "Layer":
layShd = mat[c4d.MATERIAL_COLOR_SHADER]
layShdFirst = layShd.GetFirstLayer()
print layShdFirst.GetParameter(c4d.LAYER_S_PARAM_SHADER_LINK)
theBitmap = c4d.BaseList2D(c4d.Xbitmap) #create a bitmap baseshader
theBitmap[c4d.BITMAPSHADER_FILENAME] = "/Woven_Black_Carpet_Flat.jpg"
theBitmap.InsertUnder(layShd)
#layShdFirst.SetParameter(c4d.LAYER_S_PARAM_ALL_ACTIVE, True)
#print layShdFirst.GetBitmap()
layShdFirst.SetParameter(c4d.LAYER_S_PARAM_SHADER_LINK, theBitmap)
layShd.Message(c4d.MSG_UPDATE)#update
shd.Message(c4d.MSG_UPDATE)#update
mat.Update(True, True)
print layShdFirst.GetParameter(c4d.LAYER_S_PARAM_SHADER_LINK)
That should work. Thanks for the clarification and pointer to the example!
I want to display what the document name that I am currently processing with my plugin. Can I use a gui.MessageDialog, or is there a better way? If I do use a gui.MessageDialog, how do I close it automatically when I move on to process the next document?
Thanks for the reply! I'll try that, though I thought that SCENEFILTER_IGNOREXREFS would keep xrefs from being loaded, and since my plugin edits the xref path/name, this would not work. But then again, perhaps I assumed wrong. I appreciate the help! By the way, the idea of classification by tags appears to be a good way to escape the messy folding out tree of classification system that we are all used to. I'll use it next time.
I have a plugin that I need to use c4d.documents.LoadFile(). I get a pop up question if I load a file with a New XRef that is missing a reference, asking a Yes or No question. Can I answer yes or no in code, or cancel the load if I get an error? I tried using c4d.documents.LoadDocument() but this is causing another xref issue. My Legacy XRefs aren't always keeping their options set and often times all display and on/off options (under the XRef O tab) all turn on. The plugin replaces text in an xref path/filename.