Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/12/2012 at 16:01, xxxxxxxx wrote:
info : R14, Vista64, Python
hi,
i have got a stupid question again. i have got a command plugin generating data for a c4d file stored in a multilevel BaseContainer. currently i am saving these data with a hyperfile which is a bad solution, because renaming or moving the c4d file breaks the connection between the data and the c4d file. so i am looking for a better place now.
i want :
possible ways i have been looking into :
* console output: * SystemError: source\pymodules\c4d\PyBaseContainer\PyBaseContainer.cpp:1095: bad argument to internal function * * * import c4d * * def main() : * bc = c4d.BaseContainer() * bc.SetBool(c4d.DOCUMENT_RENDERLOD, True) * doc.SetData(c4d.DOCUMENT_RENDERLOD, bc) * * if __name__=='__main__': * main() *
3. so, how is the correct way to feed this method ? 4. can i use own type ids and which id would i have to use without conflicting with other ids ? my plugin id ?
sorry for this bunch of questions, but i have really tried to solve this on my own without any real success. i would be really thankful for a push into the right direction. i have also tried the search function on this without any useable result.
thanks for reading and any help.
On 18/12/2012 at 00:28, xxxxxxxx wrote:
Hi Ferdinand,
To easily save data within a document or object, check this post. This is the simplest way in Python but remember that the ID to store the data has to be unique; generate it like a plugin ID.
BaseDocument.SetData() is only useful with the defined document settings.
Originally posted by xxxxxxxx console output: SystemError: source\pymodules\c4d\PyBaseContainer\PyBaseContainer.cpp:1095: bad argument to internal function import c4d def main() : bc = c4d.BaseContainer() bc.SetBool(c4d.DOCUMENT_RENDERLOD, True) doc.SetData(c4d.DOCUMENT_RENDERLOD, bc) if __name__=='__main__': main()
Originally posted by xxxxxxxx
console output: SystemError: source\pymodules\c4d\PyBaseContainer\PyBaseContainer.cpp:1095: bad argument to internal function import c4d def main() : bc = c4d.BaseContainer() bc.SetBool(c4d.DOCUMENT_RENDERLOD, True) doc.SetData(c4d.DOCUMENT_RENDERLOD, bc) if __name__=='__main__': main()
In Python you can just do this:
import c4d def main() : doc[c4d.DOCUMENT_LOD] = 0.5 c4d.EventAdd() if __name__=='__main__': main()
So, basically the operator [] is the way to go when dealing with parameters and the CINEMA API.
On 18/12/2012 at 04:26, xxxxxxxx wrote:
thanks