Use GetDataInstance - Dont use GetDataInstance?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/04/2012 at 12:42, xxxxxxxx wrote:
It all helps to fill in the blanks - cheers for the pointers (no pun intended)
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/04/2012 at 13:13, xxxxxxxx wrote:
@Sebastian: Interesting, thank you! I think this enlightens my knowledge a little more. I was always
wondering how, just for example, the Dynamics tag interacts with the Cloner object (as it doesn't
seem to be possible by modifieng the cache directly). I guess that is the way the information is being
exchanged between the Cloner and the Tag (using Get~()/SetParameter())? Please correct me if I'm
wrong.Thanks,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/04/2012 at 14:26, xxxxxxxx wrote:
Thanks Sebastian for the info.
So using GetDataInstance() is no problem (other than future compatibility) when:
- Creating an object from scratch (point by point) with my own functions, AND,
- I only use my own parameters (no includes), AND,
- I need the fastest possible speed for calculations.Right?
(I have a few of those "ABC can't bigger than XYZ when…" but they are
taken care of post reading the container into the functions.)Cheers
Lennart -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/04/2012 at 13:46, xxxxxxxx wrote:
Topic-push 'cause offc. SDK guys often only see the top post.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2012 at 01:37, xxxxxxxx wrote:
So using GetDataInstance() is no problem (other than future compatibility) when: - Creating an object from scratch (point by point) with my own functions, AND, - I only use my own parameters (no includes), AND, - I need the fastest possible speed for calculations. Right?
I would use BaseList2D.__setitem__ to be on the safe side.
Cheers, Sebastian
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2012 at 04:29, xxxxxxxx wrote:
Thanks again. So, sorry to be ignorant (not understanding).
When you say " BaseList2D.__getitem/__setitem__" that is the same as using:
def Init(self,op) op[c4d.MY_ID] = 123 return True def Execute(self…. etc) myvalue = op[c4d.MY_ID]
?
In other words, exactly the way how to get/set from/to the AM for any object.Cheers
Lennart -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2012 at 04:36, xxxxxxxx wrote:
yes, the bracket syntax is the snytax to call __setitem__ and __getitem__. it is explained in the
GetParameter thread.https://developers.maxon.net/forum/topic/5284/5286_please-use-getparametersetparameter
hadn't we this discussion already a week ago on cgtalk ?
http://forums.cgsociety.org/showpost.php?p=7294996&postcount=28
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2012 at 04:45, xxxxxxxx wrote:
I'm asking because I have a follow up of that and that it is still
a recommendation only, that's way. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2012 at 13:00, xxxxxxxx wrote:
littledevil, I'm not trying to be thick or anything,
my concern is that while __getitem/setitem__ is recommended now,
Sebastian wrote that:
"overriding GetDParameter/SetDParamter, this is not possible in Python yet".Which means , for me, that instead of re write a year worth of plugins now,
to __set/getitem__ and then only to find out that GetDParameter/SetDParamter
is a recommended way.
As much as making tools are rewarded/needed, I rather do work that brings
food on my table than code. That's all.Cheers
Lennart -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/04/2012 at 13:22, xxxxxxxx wrote:
well,
i am neither very experienced, nor i have the techincal background to understand fully why we
are supposed to use Get/setParameter. I am just following the thread where Rick Barret states,
that the bracket syntax aka setitem / getitem is the correct way in python and the equivalent to
the c++ Get/SetParameter syntax.the wrong way in python would be to use GetDatainstance and then set the values via Set Type (),
just as in c++. if i have understood something wrong with your concerns, forgive my lousy english
pleaseps : that you are not able to overwrite Get/SetParameter, is only a problem if you are not storing
your plugins data within the plugins bc, or am i mistaken here ?