I'm trying to get a python generator to only refresh when a source object is dirty, but can't seem to get it to work.
I move the object, change its geometry, change its parameters, it is never recognized as dirty.
I tried many different Dirty Flags and I can't get it to work.
Any idea what I'm doing wrong?
obj = op[c4d.ID_USERDATA,2]
print "object is dirty"
@r_gigante The reason I'm going with Gumroad is because it provides a system that I can automate as an indie developer. I can make useful C4D tools and plugins, but I'm not a web developer nor a fully-fledged programmer.
The current license system in Cinema 4D implies that the user generates License Information and sends it to the plugin developer to get get a personalized key back.
I could do this either by hand via emails, or by implementing an automated system on a website with an online software that does that.
The first option is a horrible ux experience for the user and a huge overhead for the developer, so it's an invalid option.
The second option requires me to become a full-blown web developer to make a simple c4d plugin, requiring completely disproportional amount of effort.
Therefore yes, I would argue having to develop our own license systems is a very big reason why c4d developers are so few.
Maxon implemented a new license system with 21, which would be great for plugins if they could use it. I.e. every plugin license to be added to the MyMaxon account, and let the maxon licensing system do the licensing. But this is not how we can use it.
Not only that but there are some very big limitations currently. If a studio account has 20 c4d licenses, I can't tie the plugin to a specific c4d version as I would with the serial numbers. I can only tie it to 1 machine, which is limiting and uncomfortable for the customer, or tie it to the account and allow them to only get 1 plugin license and use it in 20 different c4d licenses simultaneously.
In the end I see redshift have it's own license server, x-particles having their own licensing system, and the indie plugin developers having no idea what to do and how to do it.
Either way the licensing system has a lot of room for improvement. Currently it doesn't seem to be made with the plugin developers in mind; especially indie developers are struggling with it, as I've noticed in numerous people I talked with.
@lasselauch Thanks Lasse, that's great advice, GetObjects() should work.
Thanks @r_gigante for the feedback. I can't really comment from experience about the previous system, as I haven't developed a plugin for it.
I would be interested however to know how would you propose to solve the example I gave.
When I was inquiring about this case when the new licensing was introduced, I couldn't find any solution either.
We want to fulfill two requirements:
1. Provide a floating plugin license that can be installed in as many machines as the user wants.
2. If they have 20 c4d licenses and they bought 3 plugin licenses, they should be able to use it with 3 out of their 20 cinema 4d licenses.
It's pretty common case, I would guess many if not most plugins would have similar requirements.
I can solve the 1st case by tying the plugin to the User ID.
I can solve the 2nd case by tying the plugin to the machine ID but that breaks the 1st case.
I don't think any of the other information such as binary type, binary version or c4d licensing type is helping with the above. I would expect to use a Cinema 4D License ID but I don't believe it exists.
Hey @Cairyn and @ferdinand , thanks you both for your input. Ferdinand thanks for getting in all the trouble to write your thoughts so extensively.
It's nice to have some approximate numbers of what the error can be.
I'm not using time-based calculations right now. It's good idea to use the time delta. I did some experimenting yesterday but it's not easy to implement in my setup. Definitely a good idea to keep it in mind for the future.
My exact case is that I do matrix transformations that normalize the matrix of the object, but I want to preserve its scale.
I have two ways of doing it:
Get current scale from the object, do matrix transforms, re-apply the pre-transform scale values. But I thought running this on every frame could cause value drifting.
Save original scale as a constant. Do matrix transforms, re-apply the scale from the constant. The constant wouldn't evolve so it wouldn't drift, and it is the approach I'm taking now. The disadvantage is that the scale is now locked and can't be changed directly.
My take is that the drift might be tiny but it can be a potential issue, so it would be wiser to stick with the second approach.
I have an expression that Reads a value from and object and Write the same value at every frame.
value = obj.GetRelPos()
"do other matrix transformations"
Is there danger for the value drifting due to calculation errors, after a lot of executions?
In Cinema 4D it oftentimes happens that we select multiple objects that are supposed to have the same value and we see <<Multiple Values>> in the attribute manager, meaning something affected some decimals to drift appart.
While the user is working this expression could execute thousands or tens of thousands of times.
I tend to prefer to give absolute, static values to objects due to this concern, but is there really something to concern about?
Thanks Ferdinand, I'll mark this as solved.
Having tried it out, a problem is the GetObjects() only gives the top objects of the document without their children.
I could make a recursive iteration to go through all of the document's objects but that would slow it down significantly...
I'd like to arrange a list of objects based on the order they have in the Object Manager.
Is there an efficient way to do that without iterating through all of the objects of the scene?
I've been searching for something like Hierarchical Distance that I could compare with the scene root, or perhaps an index of the object in the Object Manager list, but haven't found something relevant.
Perhaps there is there another idea on how to achieve it?
I noticed the above code didn't work in R21 because urllib changed in Python 3.
The following topic has information on how to handle it:
"NOCAMERA;" worked, and the priority was a typo, now it does work!