Create your first Cinema 4D plugin from scratch

  Рет қаралды 5,209

Safina3D

Safina3D

Күн бұрын

Пікірлер: 58
@ilirbeqiri
@ilirbeqiri 3 жыл бұрын
Very detailed indeed, no part left in the dark! No voice over needed! Thanks a lot!
@safina3dee
@safina3dee 3 жыл бұрын
you're welcome!
@claytonkrause4382
@claytonkrause4382 2 жыл бұрын
Great tutorial! What extension are you using in VS Code to syntax highlight .pyp files? I have the Python extension by Microsoft installed, but it doesn't pickup and .pyp. To get highlight to work, I need to change the .pyp extension to .py and back again in the VS Code folder explorer which is a bit hacky. Thank you.
@stereo_stan
@stereo_stan 3 жыл бұрын
This is a great tutorial! I am curious, do you know how someone could add a spline graph to the GUI?
@safina3dee
@safina3dee 3 жыл бұрын
Hi! sorry for my late answer, I was on vacation. Regarding your question, I think you can use the Spline widget or the SplineCustomGui class to create the GUI, in combination with the SplineData class for data manipulation : - Spline widget : developers.maxon.net/docs/Cinema4DCPPSDK/html/page_descriptionresource__s_p_l_i_n_e.html - SplineCustomGui : developers.maxon.net/docs/Cinema4DCPPSDK/html/class_spline_custom_gui.html - SplineData : developers.maxon.net/docs/Cinema4DCPPSDK/html/class_spline_data.html
@safina3dee
@safina3dee 3 жыл бұрын
here you can find a quick example of how it works : gist.github.com/safina3d/49231408c4a549814b39b293b149d687
@stereostan3220
@stereostan3220 3 жыл бұрын
@@safina3dee Thank you Safina I appreciate the example and the great tutorial!
@leoakimono3631
@leoakimono3631 3 жыл бұрын
Hi, mister. I wonder if people can make a plugin that allows you to controll the camera with keyboard WASD like in a FPS game. That will be super helpful to navigate in a building and for making real time recording animation.
@dr_Fox
@dr_Fox 3 жыл бұрын
Hi. Got one more doubt. How to set some parameters in our objectdata plugin grayed out, and unless some condition is met, user can access that user data.?
@safina3dee
@safina3dee 3 жыл бұрын
Hi! I think the GetDEnabling method is what you are looking for : developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.plugins/BaseData/NodeData/index.html?highlight=getdenabling#NodeData.GetDEnabling
@antoniopepe
@antoniopepe 3 жыл бұрын
Dude I should do something and I don't know where to start. Imagine that I have a series of objects, say 100.These objects have baked keyframes. I would like to automate that a Bones is created in the position of each object and May it acquire its animation. Delete the animation from the original box and bind to this object. After doing it to all the objects you collapse the geometries in order to have the 100 animated Bones and a single mesh. How can I approach such a thing.?
@creeper20ps
@creeper20ps 4 жыл бұрын
Thank you for this. Its rare to find C4D python. Let alone C4D plugin python.
@dr_Fox
@dr_Fox 3 жыл бұрын
Is there a way to change a parameter datatype on the run? The type is set from the Res file. For example, there is a Real parameter in my plugin that need to change to VECTOR type Input or STRING or some other dynamically with a dropbox data change, Like the value in compare node in Xpresso.
@safina3dee
@safina3dee 3 жыл бұрын
You can do that by overriding the GetDDescription method : developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.plugins/BaseData/NodeData/index.html?highlight=getddescription#NodeData.GetDDescription
@dr_Fox
@dr_Fox 3 жыл бұрын
@@safina3dee Seems these NodeData methods are very confusing for me.
@safina3dee
@safina3dee 3 жыл бұрын
@@dr_Fox I did a quick example : gist.github.com/safina3d/4ae01c085ad1f9eaadf4c0551caaf452
@dr_Fox
@dr_Fox 3 жыл бұрын
@@safina3dee Thank You..! It worked, Even though I didn't get the logic, I modified your code to work for me. Thanks a lot.
@Baghdad_TV
@Baghdad_TV 5 жыл бұрын
مبدع ،،،، ياريت نسمع صوتك يا فنان
@basilcmr
@basilcmr 3 жыл бұрын
Is there a way instead of making multiple pyp files, to put all the codes in one for multiple object data plugin?
@safina3dee
@safina3dee 3 жыл бұрын
Yes of course, you can register multiple plugins in the same file
@dr_Fox
@dr_Fox 3 жыл бұрын
Hi, I m making an object plugin. But I need some codes to work when I load the plugin, Just like commanddata plugins. If I put it to Init(), It repeats the code again and again when I make a change and play the animation.I just need it to work on when I load the plugin.
@safina3dee
@safina3dee 3 жыл бұрын
Hi, It depends on what you are trying to achieve. but, here are some ideas: - make sure you add self.SetOptimizeCache (True) to your constructor. This avoids unnecessary calculations, especially when there is no change. - you can override the Message method and catch the MSG_MENUPREPARE event (which is called once) just like this: def Message (self, node, type, data): if type == c4d.MSG_MENUPREPARE: # your code here return True - or even ... how about using a global function that you call after a successful plugin registration ... If RegisterObjectPlugin…. : # your code here
@dr_Fox
@dr_Fox 3 жыл бұрын
@@safina3dee Lemme try that. Thanks
@dr_Fox
@dr_Fox 3 жыл бұрын
@@safina3dee If I did it in RegisterObjectPlugin, won't it works when I launch C4D? I thought so.
@safina3dee
@safina3dee 3 жыл бұрын
@@dr_Fox You're totally right! that's why I said it depends.. however, if want to execute your code once everytime you launch your plugin MSG_MENUPREPARE should be a good alternative
@dr_Fox
@dr_Fox 3 жыл бұрын
@@safina3dee MSG_MENUPREPARE Worked Thanks.
@abhijithb542
@abhijithb542 4 жыл бұрын
How I can develop the cinema 4d plugin? What are the basic fundamentals to develop c4d plugin. Please reply.
@safina3dee
@safina3dee 4 жыл бұрын
To create C4D plugins, you need (at least) : - Basic knowledge of python/C++ language and OOP (object oriented programming) - Know how to read and use C4D python/C++ SDK documentation - Some coffee or tea :)
@abhijithb542
@abhijithb542 4 жыл бұрын
@@safina3dee I write so many after effects script(which are JavaScript).But how I start learning c4d plugin. Is there any course for this?
@safina3dee
@safina3dee 4 жыл бұрын
@@abhijithb542 Writing C4D plugins isn't that difficult, you can start by reading the source code of the existing plugins. - The current video is a good start ;) - Python resources: developers.maxon.net/docs/Cinema4DPythonSDK/html/manuals/introduction/python_resources.html - C4D plugins & scripts examples : github.com/PluginCafe/cinema4d_py_sdk_extended
@andyrvrs
@andyrvrs 4 жыл бұрын
im having trouble understanding how you use the formula for the torus, can you explain a little further if youll be so kind
@safina3dee
@safina3dee 4 жыл бұрын
Hi, I'll try to make it simple as possible : A knot can be considered as a "deformation" of a circle. with this said, a Torus knot can be defined (just like a circle) in a range of 0 to k*2*Pi, with k (an integer) to get a multiple of 2*Pi. Those two values are represented in the plugin by "Range min" and "Range Max". So, to draw a Torus Knot we are basically just making a loop from "Range min" ex: 0 to "Range max" ex: 2, and creating a new point every "Step" value. which means, if we have 0.1 for the step we will get (2*Pi) / (0.1*Pi) = 20 points. "R" is the outer radius, and "r" the inner one. And finally "n" is the number of crossings or intersections. Depending on the kind of torus knot that you are trying to achieve, the right "n" value can be found by divding the p and q values from the Torus Knot definition ( katlas.org/wiki/36_Torus_Knots ). for instance, for the torus T(3,2), n=3/2=1.5 and for torus T(5,2), n=5/2=2.5, and so on... hope I answered to your question :)
@SJLV123
@SJLV123 5 жыл бұрын
should the same workflow work in R18? I get a < AttributeError : 'module' object has no attribute ..... >
@safina3dee
@safina3dee 5 жыл бұрын
Yes of course .. Can you copy here all your "import" instructions and the complete error message ? thank you
@SJLV123
@SJLV123 4 жыл бұрын
@@safina3dee hello, thanks for the reply. The problem was that the [c4d.DATA_NAME] did not function, solved by removing the c4d-prefix and declaring the variables in the beginning of the pyp file.
@stereostan3220
@stereostan3220 3 жыл бұрын
Awesome thank you for this
@Totorus
@Totorus 2 жыл бұрын
Thanks for sharing!!!
@kogonoslmsa
@kogonoslmsa 2 жыл бұрын
thank you so much
@YangAnimationArist
@YangAnimationArist 5 жыл бұрын
awesome man, how can I use visual studio for this? Please show me
@safina3dee
@safina3dee 5 жыл бұрын
In Visual Studio, create a new empty python app and follow the tutorial :) But for kind type of development, I'd recommend you to use a "lighter" IDE or text editor like pycharm or VS code (which I use in this tutorial) or sublimetext or atom, etc ...
@aleksandr1277
@aleksandr1277 10 ай бұрын
very nice!
@hossamsaeed5310
@hossamsaeed5310 2 жыл бұрын
You got a new sub
@ExpressoMechanicTV
@ExpressoMechanicTV 3 жыл бұрын
Brilliant.
@safina3dee
@safina3dee 3 жыл бұрын
Thank you 👍
@basilcmr
@basilcmr 3 жыл бұрын
Please do a tutorial, on how to use fields with python. at this point, I feel like without fields everything is pointless. How to get fields to work with a plugin, How to get data out of fields, like (0 to 1 values on world space or something!). With Fields API in official documentation, I don understand a thing there.
@basilcmr
@basilcmr 3 жыл бұрын
For example, how to set a kill volume for Thinking particle with fields? Or PGroup change with field.?
@safina3dee
@safina3dee 3 жыл бұрын
​@@basilcmrNever tried, but very interesting question 👍 I'll check the documentation and see if I can do something about it
@basilcmr
@basilcmr 3 жыл бұрын
@@safina3dee Thanks. Something is coming up from my part. It'd be awesome, if I can include fields in it.
@TheNimRC
@TheNimRC 2 жыл бұрын
Thanks Safina! Would it be difficult to adjust the script so it can generate the fourth prime knot from here, or any other prime knot for that matter?: puu.sh/IKQ59/a662b2dd49.png
@Thysta
@Thysta Жыл бұрын
Amazing, thank you!
Cinema4D: Wrinkle/Tension map
11:29
Mr Anderson Tutorials
Рет қаралды 12 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Procedural Quadtree | Cinema 4d tutorial
19:40
zerosixtwosix
Рет қаралды 32 М.
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 740 М.
I Recreated Arcane With $0
15:01
Noggi
Рет қаралды 1,6 МЛН
NATO intercepts Russian planes / Strike on the marines
14:04
NEXTA Live
Рет қаралды 497 М.
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 941 М.
Cinema 4D Tutorial: Easy Embedded Cloth Look with Only Deformers
6:46
thepixellab2011
Рет қаралды 56 М.
Color Quantization and Dithering
11:55
Acerola
Рет қаралды 451 М.
How I make bots using python (educational)
17:12
Kian Brose
Рет қаралды 571 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН