본문 바로가기

Category

(330)
[jetbrains] Use clipboard in IdeaVim Click Open ~/.ideavimrc Add following line set clipboard+=unnamed :)
[c4dpython] Tag Tag 태그 가져오는 코드 tags = object.GetTags() 특정 태그만 가져오는 건 아래처럼 하면 됩니다. doc = c4d.documents.GetActiveDocument() op = doc.GetActiveObject() wt = op.GetTag(c4d.Tvertexmap)
[3dsMax python] Menu & Macroscript with pymxs Menu 맥스에 맨위에 메뉴바가 있는데 여기를 코드로 수정, 추가하는 법을 알아보려고 합니다. 기존메뉴에 추가/삭제 3ds Max 2021 버전에서는 런타임 글로벌 변수를 쉽게 만들수 있지만(rt.a = 'hi'), 그 하위 버전에는 아래 코드 처럼 만들어야 합니다.ㅜㅜ (한참 찾음) 그리고 매크로 스크립트를 생성해주고, 메뉴아이템을 만들어 줍니다. from pymxs import runtime as rt import re def myfunc(): print 'Hello' rt.execute('global abcd') rt.globalVars.set('abcd', myfunc) # category, macroName, tooltip, text, function t = rt.macros.new('test'..
[vscode] vscode vim copy and paste using Clipboard The default of copy repository is x11 that different with clipboard. Add the following line at setting.json file "vim.useSystemClipboard": true
[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 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 ..
[c4d python] 스크립트 사용법 (+ Plugin) Cinema 4D 3D 디자이너들은 다양한 툴을 다루는것 같은데, 그중 Cinema 4D 라는 툴도 유명한것 같습니다. 우연히 기회가 생겨 Cinema 4D 플러그인을 만들어 볼려고 합니다. 😎 환경구축 자동완성이나 Lint도 있는 것 같지만, 일단 제일 기본적인 환경구축을 해볼려고 합니다. Script 탭에서 Console과 Script Manager를 킵니다. 그리고 저는 파이참에서 코딩을 하고, 파일을 Script Manager로 Open 해서 실행을 했습니다. 첫 코드! 선택한 오브젝트의 이름을 출력해보자! obj = doc.GetActiveObject() print obj.GetName() 출력이 되네요! 저 파란색부분을 드래스 해서 위에 버튼으로 만들수도 있습니다😀 하지만 두개를 클릭하면 에러..