Dev/cinema4d
연습 소스
obj = doc.GetActiveObject() doc = c4d.documents.GetActiveDocument() obj = doc.GetActiveObject() name = obj.GetName() type = obj.GetType() points = obj.GetAllPoints() import c4d dpef run(): o = doc.GetActiveObject() if o == None: return cv = o[c4d.ID_BASEOBJECT_VISIBILITY_EDIT] if cv == 2: # default o[c4d.ID_BASEOBJECT_VISIBILITY_EDIT] = 0 if cv == 0: o[c4d.ID_BASEOBJECT_VISIBILITY_EDIT] = 1 if c..

스크립트 기본
이름설정 하는법 주석으로 이름을 지정하면 이름과 설명이 됩니다. developers.maxon.net/docs/Cinema4DPythonSDK/html/manuals/introduction/python_script_manager.html Python Script Manager — Cinema 4D SDK 23.110 documentation When an object, tag, shader, or even a parameter is dragged and dropped into the script manager, a place holder variable named as the element is created. Since this variable is assigned to nothing in the cu..
baseContainer에 대해
그냥 데이터 저장하는 객체인데 c4d에서 사용되는 객체입니다. 여기에 값을 저장해서 len도 찍을수 있고, 저장해서 다른 함수로 넘길수도 있습니다. 저는 다른 스크립트로 값을 넘길때 baseContainer를 사용했습니다. developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d/BaseContainer/index.html?highlight=basecontainer c4d.BaseContainer — Cinema 4D SDK 23.110 documentation Once you’ve set a container value using one type you must neither try to access it using another type, nor o..
![[c4dpython] How to use excel in c4d python](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdYulyZ%2FbtqZTVkTO6X%2FyDroiYHrk5qqqMTy25VxwK%2Fimg.jpg)
[c4dpython] How to use excel in c4d python
C:\Program Files\MAXON\Cinema 4D R19\resource\modules\python\Python.win64.framework\Lib\site-packages unzip xlrd and xlsxwriter
![[c4dpython] Tag](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbBW2T9%2FbtqWjpi9FmY%2FWppbmtdztb838KuGdR4iek%2Fimg.jpg)
[c4dpython] Tag
Tag 태그 가져오는 코드 tags = object.GetTags() 특정 태그만 가져오는 건 아래처럼 하면 됩니다. doc = c4d.documents.GetActiveDocument() op = doc.GetActiveObject() wt = op.GetTag(c4d.Tvertexmap)
![[c4dpython] material & texture](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbkCW6z%2FbtqUGUSvnFm%2F6s3MfjZvlBNRcp8qkK0i6K%2Fimg.jpg)
[c4dpython] material & texture
Create material import c4d material = c4d.Material() material.SetName("Generator Material") material[c4d.MATERIAL_COLOR_COLOR] = c4d.Vector(1, 0, 0) doc.InsertMaterial(material, None) // 여기에 checknames=False 하면 중복된 재질 이름 생성 허용 c4d.EventAdd() Find Material materials = doc.GetMaterials() for mat in materials: Apply material Material를 Texture Tag를 이용해 Object 에 적용합니다. tag = c4d.TextureTag() tag.SetM..
![[c4dpython] GUI](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fc1Ee6O%2FbtqUJXg64mK%2F4zTgMLp5KHo1EXA8X1nlP0%2Fimg.jpg)
[c4dpython] GUI
GUI yes no dialog rvalue = c4d.gui.QuestionDialog("Hello") input dialog name = c4d.gui.InputDialog("input:") alert c4d.gui.MessageDialog("This document has not been previously saved, please save it now.") File Explorer (load) 이건 파일탐색기와 함께 파일이름 가져오기 import c4d fn = c4d.storage.LoadDialog() doc = c4d.documents.LoadDocument(fn.decode("utf8")) file_name = c4d.storage.LoadDialog(type=c4d.FILESELECTTY..
[c4d python] object
오브젝트 가져오기 for obj in doc.GetObjects(): children = object.GetChildren() import c4d from c4d import gui def test(): o = doc.GetActiveObject() # Only one object # o = doc.GetActiveObjects(0) # return list if not o: return o.SetName('test') c4d.EventAdd() if __name__ == '__main__': test() import c4d from c4d import gui def test(): print 'hello' o = doc.GetActiveObjects(0) if o == []: return newName ..