UV Peeler - accessible?
-
Hi - I'm wondering if the UV Peeler is accessible via python. I see it listed in the SDK but I'm not familiar with how to use it.
Can it be used with SendModelingCommand or bodypaint.CallUVCommand?
The documentation references C4DAtom.SetParameter() but I've never used this.
Any info that can push me in the right direction is appreciated.
thanks,
.del -
hi,
The tool UV Peeler must have some edge selected that will be used as seems. In this thread, you will find some useful information how to do that.
To Apply the UV Peeler you have two options. One using the script log that will write for you almost all the code you need or using the function SendmodelingCommand.
There is no public symbol defined for this tool, you need to use the value itself.
import c4d from c4d import gui # using the script log only def MethodeOne(): def tool() -> c4d.plugins.BasePlugin: return c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL) c4d.CallCommand(1031207) # UV Peeler uvPeeler = tool() uvPeeler[c4d.MDATA_UVPEELER_MIN_U] = 0.29 c4d.CallButton(uvPeeler, c4d.MDATA_UVPEELER_APPLY) def main(): # using the fuinction SendModelingCommand. # Parameter of the tool must be defined. settings = c4d.BaseContainer() settings[c4d.MDATA_UVPEELER_MIN_U] = 0.29 settings[c4d.MDATA_UVPEELER_MAX_U] = 1 settings[c4d.MDATA_UVPEELER_MIN_V] = 0 settings[c4d.MDATA_UVPEELER_MAX_V] = 1 settings[c4d.MDATA_UVPEELER_U_UNIFORMITY] = 1 settings[c4d.MDATA_UVPEELER_V_UNIFORMITY] = 0 # There is no symbol that define the UVPeeler tool id. Use the value instead. res = c4d.utils.SendModelingCommand(command=1031207, list=[op], bc=settings, doc=doc) c4d.EventAdd() # Execute main() if __name__=='__main__': main()
Cheers,
Manuel -
HI -
Thanks for the response!
I'm going to go with the sendModelingCommand method. I never would have thought to put the CallCommand value in there.
This is really going to help me finish this script. I appreciate your help.
thank you,
.del