@mikeudin Thx Mike,
Even though I don't speak a word of Russian, I do like your movies :)
Working in R20-S24
Best posts made by jochemdk
@m_adam
Hi, I did some more testing…
Things only go wrong with a linearCloner’s offset if:
_ any applied baseEffector has the visibility check turned on
_ has a mograph selection/weight tag
_ and if a linearCloner’s offset >= the smallest index of the selection
_ (so random has nothing to do with it :)
Hi @m_adam, thx for your input, it does reset the WeightManager, but doesn’t do the autoWeighting accordingly..
_First thing I noticed: a difference between int 64 & 32. Not sure if this might be a problem..
Reading the GET> AutoWeight…base.jointcount : <int64> “number of joints”
Reading the SET> AutoWeight…base.jointcount : <int32> “number of joints”
_After the WeightManager is being set (to 1 joint in my case), I can’t click on the “Calculate button” manually.
Nothing happens, unless I change the joint count manually to another number. So something in the update hasn’t been applied..
Note that reading the dict says <int32>, until manually changed, than is says <int64> again..
_I also tried wmgr.SetDirty(doc) / wmgr.Update(doc) / followed by another c4d.EventAdd().. Perhaps these need a different approach as well?
I tried to find something in the “maxon/frameworks” folders you linked to, but couldn’t find any info on how to tackle this issue.
So the current status is still that “default weighting” is applied.
If you can please help in the right direction, it would be greatly appreciated, tia, Jochem
import c4d, maxon
from maxon.frameworks import animation
def main():
doc = c4d.documents.GetActiveDocument()
wmgr = c4d.modules.character.CAWeightMgr
#wmgr.SetDirty(doc)
heatmap_id = wmgr.GetAutoWeightAlgoId(doc, 1) # heatmap
settings = wmgr.GetAutoWeightDictionary(doc, heatmap_id)
settings.Set(maxon.frameworks.animation.AUTOWEIGHTPARAMETERS.JOINTCOUNT, 1)
settings.Set(maxon.frameworks.animation.AUTOWEIGHTPARAMETERS.SELECTEDPOINTS, False)
settings.Set(maxon.frameworks.animation.AUTOWEIGHTPARAMETERS.ALLOWZEROLENGTH, False)
wmgr.SetAutoWeightDictionary(doc, settings, heatmap_id)
#doc.ExecutePasses(None,True,True,True,flags=c4d.BUILDFLAGS_NONE)
c4d.EventAdd()
# getWeightTag - setActive
firstJoint = doc.GetFirstObject().GetDown().GetDown() # just in my testDoc..
weightTag = (firstJoint.GetWeightTag())["op"]
doc.SetActiveTag(weightTag, c4d.SELECTION_NEW)
#weightTag.GetObject().SetBit(c4d.BIT_ACTIVE)
# update weightManager / doesn't make any difference..
#wmgr.SetDirty(doc)
#wmgr.Update(doc)
#c4d.EventAdd()
# autoWeight func
wmgr.SelectAllJoints(doc)
bla = wmgr.AutoWeight(doc)
print(bla) # prints True, but not in the right way :{
c4d.EventAdd()
if __name__=='__main__':
main()
Latest posts made by jochemdk
Hi, since I updated C4D to the latest version [2023.2.1] this morning a large script of mine stopped working.
Something happened to the way the AEC file is exported. My main concern is that some characters in my naming convention are replaced by underscores.
For example a null exported as "AEC+,;M1" is now called "AEC___M1" when I read the aec as a simple text document.
This is just a simple example, but I've got lots of naming dependencies with an After Effects JSX script...
Can someone please check what happened, I would be very grateful, thx in advance, Jochem
Thx for updating.. 2023.1 seems to be working well again
Hi manuel,
Thx for answering. The first part of my previous reply was native C4D, so I'll send a simple file to regular support.
As stated in my initial question, I spent almost a day trying to isolate the issue which I thought was an issue within my script, which wasn't the case.
Seems I have to accept normal instances to be slow & adjust my scripts accordingly.. Thx, Jochem
Edit / fyi: Just got this back from support: "As I can reproduce your issue here, I reported it to our development."
Hi @iplai,
Thx for your answer. Changing the mode in 2023 to renderInstance gives me about 40 FPS & multiInstance about 54 FPS. This is still less on my machine, but better than the normal instance :}
For another script, I'm heavily relying on instances (not the other 2..). Is there anything I can change/adjust/script to make the normal instanceMode work decently? Or is that now something of the past?
Hope there's some info about it, thx, Jochem.
Hi all,
Yesterday I was revisiting an old project of mine & spent almost the entire day figuring out why the hell it was so slow in R2023..
So this morning I made a simple setup, with just a basic cloner - with a plainEffector - who has a moWeight tag as a selection - and where the weightTag is driven by a randomField.. nothing special.
Running this simple thing in R26 vs 2023 gave an amazing speed reduction - see the image below (on the left)..
So, the issue was not my pyScript.. it has about 800 lines of checks & calculations so to me it's fine that it runs 6 FPS slower in R26 than the randomField example. (the image in the middle..)
Please note the FPS getting even slower when a pyTag is attached to the cloner in 2023. (image on the right)
Is there some temporary moGraph issue in 2023, or can this be something different?
Can't see any changes in the docs, Hope someone knows, tia, Jochem
Done, didn't know I could do it myself :}
Hi @manuel,
Thx for your reply. You might be surprised again... your code also works from the main func of a pyTag :} (But that's probably because of the buttons running in the mainThread..)
Consider it solved, Jochem
Hi,
I just installed 2023 and discovered parts of my scripts stopped functioning, because you can’t insert any tag into an In-Exclusion list anymore? :{
The In-ExclusionData is just a simple userData item on a pythonTag..
I included a simple script below, which works in previous versions of C4D - Just a pyTag (on a Null) with 3 pieces of user data (2 buttons and an inex List..)
So, A - I’m hoping this is a temporary bug.
or B - There’s a new way to automatically insert (especially python)Tags in some sort of list. (couldn’t find any changes in de docs..)
Please let me know, really need a solution.
tia, Jochem
import c4d # just a simple example..
def add():
inexList = op[c4d.ID_USERDATA,3]
item = op # <<< can't insert "op" or other pyTags anymore?..
item = op.GetObject().GetTag(5698) # e.g. vibrationTag, seems I can't insert any tag..
item = op.GetObject() # this works..
inexList.InsertObject(item, 0)
op[c4d.ID_USERDATA,3] = inexList
def rem():
op[c4d.ID_USERDATA,3] = c4d.InExcludeData()
def message(id, data):
if id == c4d.MSG_DESCRIPTION_COMMAND:
id2 = data['id'][0].id
if id2 == c4d.ID_USERDATA:
userDataId = data['id'][1].id
if userDataId == 1: add()
if userDataId == 2: rem()
def main(): pass
Hi @ferdinand, Learned a couple of new tricks, almost had a good solution, but in the end it still wasn't 100% safe.. So I decided to just disable the pyTags in such a way they never would be able to initialize again. Not the nicest solution, but anyhow.. Thx for your input - consider the topic closed.
Thx @ferdinand for the input, I'll look at it as soon as I can!