Jump to content

kweso

Premium Member
  • Posts

    266
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by kweso

  1. hey, i thought it would be possible to bake a texture directly to an other shader via python without having to save a file / files to the harddisc... realtimeIllumBake.c4d I guess I hit a wall there. But if anyone would have some input, I would highly appreciate it! tyvm, kws
  2. doesnt have to be plight. i just want to check where and how much an objects vertices are hit by any of my many spot lights in the scene. then generate a vertex map from it.
  3. thx for your replies, i've done it with: def message(id, data): if id == c4d.MSG_DESCRIPTION_CHECKUPDATE: print data['descid'][1].id where data['descid'][1].id gives me the id of the user data. this user data has to be on the python tag (would rather have it on the object featuring the py-tag, but it works). did not find a solution to check for matrix changes of particular objects somewhere in the scene.
  4. Hey all, is there anything like the plight-node, that is availiable in xpresso, in python? I looked at c4d.modules.thinkingparticles but could not find something. TYVM! kws
  5. so I would have to set conditions for every possible change, a object could have. is there not a kind of event system in c4d-python? thx
  6. Thx for the input. A really powerful tag. Never payed attention to it. But for this case I fear it is not the way to go. I actually want to transform my objects an then have the script in my python tag react to it (update other objects). And, as i wrote, I want the same for user data. So if i change a slider, i want to e.g. readjust a spline in the scene. Of course, i could just let my function run continuously but that would drain on performance. My example in more detail: I have five n-Side splines and n free form splines. The python script is making the free form splines run through the corners of my n-Sides. So now i want to have a slider controlling the number of sides of my n-Sides. And then add or remove free form splines accordingly my script. As is said, I could let the script run continuously, but that would kill performance. And it is only needed, when the user changes the slider... thx, kws
  7. Hey, with the python tag, is it possible, to have functions be called on certain events (and only then)? Like if I change the transform of a certain object or certain user data fields? tyvm! kws
  8. Hey, thanks to [URL=http://forums.cgsociety.org/showthread.php?f=47&t=1443665]Cairyn[/URL] @ cgtalk I got my setup to control multiple splines with nSides: import c4d import random import math def main(): streaks = [] stkContainer = doc.SearchObject("Splines") stkContChildren = stkContainer.GetChildren() for idx in range(len(stkContChildren)): item = stkContChildren[idx] if "streak" in item.GetName().lower(): item.SetName("streak_" + str(idx+1)) streaks.append(item) handles = [] hndContainer = doc.SearchObject("Handles") hndContChildren = hndContainer.GetChildren() for idx in range(len(hndContChildren)): item = hndContChildren[idx] if "side" in item.GetName().lower(): item.SetName("nSide_" + str(idx+1)) handles.append(item) corners = item[c4d.PRIM_NSIDE_SIDES] radius = item[c4d.PRIM_NSIDE_RADIUS] angle = 360 / corners for cornerID in range(corners): xxx = math.sin(angle*cornerID * math.pi / 180) * radius yyy = math.cos(angle*cornerID * math.pi / 180) * radius globalPos = item.GetMg() * c4d.Vector(0, xxx, yyy) streaks[cornerID].SetPoint(idx, globalPos) streaks[cornerID].Message(c4d.MSG_UPDATE) [/CODE] Works great, but the thing is, the script is already heavy on performance. Is there a possibility to calculate the script ONLY if one of the nSides is moved or otherwise changed? tyvm, kws
  9. hey, i tried this already over at cgtalk, but it seems that here are more c4d-specialized people. so plz excuse the double post... as i see it here you cant read the velocity of a clone directly. i wanted to calculate it myself from MODATA_MATRIX and MODATA_LASTMAT but LASTMAT only works on particles it seems. how would i get the last frames matrix of a clone?or is there an other way to read a clones velocity?tyvm again!
×
×
  • Create New...