Sigh... still no TexBox support in R21...
Is this still on your todo list?
Hey thanks ALOT, Manuel !
i'm creating the plane in a different way,
because i double the polygon sizes with distance
still, i must check your code for learning!
the phong & material tag solution is gold :)
all works like a charm, now :)
still working on it, it looks very promising...
generating the geometry seems to work fast enough, but...
adding a phong tag to the python generator has no effect
the solution for this is here:
but would it be possible to get UVs for such a plane?
c4d.utils.GenerateUVW() ? TempUVHandle ?
similar to the phong tag solution i tried to add an uvw tag to the generators cache object with:
uvw = c4d.BaseTag(c4d.Tuvw) polygon.InsertTag(uvw)
now, if i convert the generator to polygons I get:
A problem with this project has been detected:
Object "OceanPlane" - Tag 5671 not in sync.
Please save and contact MAXON Support
with a description of the last used commands, actions or plugins.
the object then has an uv tag, tough,
but mapping does not work, yet.
any tips to get working uv coordinates on such a plane object?
thank you manuel,
atm i'm going another way...
i guess this is probably faster anyway
(compared to setting up all points manually)
adjacent polygons are not sharing the same points in your code, right?
this is the tricky thing with setting up a plane, i guess .)
thank you guys,
im intrigued to make something like this as a Python Generator
not such an easy algorithm, tough
... isnt there a built in solution for something like that?
adaptive / falloff subdivision ....
i guess what would be best is an adaptive plane....
i still wonder if the code above is good,
or if it hogs down because of event loops
i know that this hogs down c4d at some point.
that is exactly why i want a dynamically adjustable object, not a fixed subdivided polygon object
like this i can test the size/subdivision my machine can handle
of course it would be even better to have a plane with a polygon-resolution-fall off
but one step at the time :)
for now it would be interesting why c4d lags that fast...
i suppose there is something not good in this code,...
thanks Flavio !
with this i came that far...
it works, but hogs down c4d very fast! (12 subdivisons are already causing a huge lag)
also writing back to the userdata causes an indefinite loop :-/
what i need is are planes of 5000 to 10000m with subdivisions of 15 to 17,
which would result in segment sizes of 7.5 to 15cm [ 500000 / (2^15) = ~15 ]
is there a way to
UserData 1 : Size (Float)
UserData 3 : Subdivision (Integer)
UserData 5 : Segment Size (Static String)
import c4d def main(): w = op[c4d.ID_USERDATA,1] # just one dimension s = op[c4d.ID_USERDATA,3] # subdivision # op[c4d.ID_USERDATA,5] = str(w / pow(2, s)) # feedback causes indefinite loop :-/ p = c4d.PolygonObject(4,1) p.SetPolygon(0, c4d.CPolygon(3,2,1,0)) p.SetPoint(0, c4d.Vector(-w/2, 0, -w/2)) p.SetPoint(1, c4d.Vector(w/2, 0, -w/2)) p.SetPoint(2, c4d.Vector(w/2, 0, w/2)) p.SetPoint(3, c4d.Vector(-w/2, 0, w/2)) bc = c4d.BaseContainer() bc[c4d.MDATA_SUBDIVIDE_SUB] = s c4d.utils.SendModelingCommand(c4d.MCOMMAND_SUBDIVIDE, [p], c4d.MODELINGCOMMANDMODE_ALL, bc, doc) #c4d.EventAdd() # is it needed here? #print "done" return p
In the built in Plane Object the segment count is (sadly) limited to 1000
Would it be possible to create an own Python Generator Plane Object without this limitation?
(I dont want a plugin solution, because that does not work with renderfarms)
import c4d def main(): w = op[c4d.ID_USERDATA,1] #witdh h = op[c4d.ID_USERDATA,2] #height ws = op[c4d.ID_USERDATA,3] #subw hs = op[c4d.ID_USERDATA,3] #subh p = c4d.BaseObject(c4d.Opolygon) .... # needs help return p
i need this for huge planes with a lot of segments (ocean surface), so it should be as fast as possible.
i think after creating an empty polygon either define all needed points/polys
or define just 4 points/1 polygon and then subdivide it