I wrote a strange script that works for both types. I will share it soon to get your feedbacks I hope
Posts made by delizade
-
RE: How to Modify the Axis of a Point Object?
-
RE: How to Modify the Axis of a Point Object?
as far as I understand those scripts only for polygon meshes. How can I made it for null objects too? and scripts does not reset scales too. it works for only rotations.
sorry for this I am not a programmer. I just need to reset tons of objects and nulls and trying to understand tose script to achieve that.
-
RE: How to Modify the Axis of a Point Object?
Hello,
thank you so much @bentraje and @ferdinand for your time and help.
also sorry for the title.and omg yes there were literally same trouble posts here but I guess I didn't know what to search for (and akso I wrote that weird title)
I will check your solutions, thank you. -
How to Modify the Axis of a Point Object?
Hello,
Here is the short scenario:
I have many objects that have different rotation values. some of them have 45 degree H, some of them -90 B etc. If I reset them from object manager Coordinate tab, naturaly object change its rotations visually. I needed to. fix them without changing their appearance. So I found a way like below:- 1- Select an object has -90 degree rotation for example
- 2- turn on Enable Axis mode
- 3- In the "Coordinate Manager" panel (not object manager. By the way for a single mesh object object manager can be used but this method can't work for Null objects) reset that value by entering 0
with this method I could fix the object gizmo without changing its current appearance but also I realized that I can't do this operation for more than one object by selecting multiple objects.
So I have to select them one by one and apply above steps. I need to use script I guess.how can I do this by Python? I've done many research but 2. and 3. steps were confusing me, I couldn't achieve those.
thank you
edited by @ferdinand Replaced title 'How can I do this with Python' with 'How to Modify the Axis of a Point Object?' -
RE: "Render Marked Takes" Command via Python?
Hi Manuel,
Thank you for your help. -
"Render Marked Takes" Command via Python?
Hello,
I need to use a button (of a python script) for "Render Marked Takes to PV" take menu command instead of reaching it via menu>submenu interaction. But I could not find a way to run it via Python. Is it possible?(In previous versions of C4D those were buttons actually. They moved them to menu I don't know why)
thank you
-
How can I make a simple input form for my Python script?
Hello,
I'm new about Python and Cinema 4D scripting. I've done many part of my script but I could not achieve to make a simple form that will get- 3 string values
- 2 check box values.
- a directory path (I need to get a target folder path)
could anyone help me about making this form please?
thank you
-
RE: How can I get a Layer's objects with Python?
Thank you so much for your time and help.
-
How can I get a Layer's objects with Python?
Hello,
I have 450 takes. Every take activates only one layer (make editor and render visibility true) of the document. (Other layers are disabled by default)I want to modify objects that belongs to that layer which is activated by a take.
After getting Layer, I need to get list of objects of that Layer by Python.
Simply I want to make:
after I activated a take I will execute a script. That script will make some modifications about objects and their materials. After that it will updates take overrides. To make those actions I need to find Active Take > Layer > Objectshow can I make this? could anyone help me about this please?
thank you
-
Content Browser modifications via Python?
Hi,
I need some information about:- save preview images or assign new preview images via Python
- How can I stop "render preview image" process in preset library? In the settings there is a check box "Render scene" but I guess it is not related to this. After I create previews for my materials by "Create Preview" if my texture library is not active and I open this preset library everything seems black. So I have to activate or add texture path in the preferences. But I really need them to browse without make any modification. SO I need to fix their preview images. Is it possible to do that via Python?
thank you
-
How to make a GUI for getting user inputs for my python script?
Hello,
I realized that I have 5 different "change name" scripts for special needs. I need an interface that I can get some inputs from that and use it in a single script. For example suffix text, prefix text, and some checkboxes in a single panel.how can I do that? As far as I learned there are some gui functions for only one input type like:
inputString=gui.InputDialog()
I need a panel that will contain different type of multiple inputs. Is it possible?
-
A GetClone problem about takes
GetClone creates a take from a source take but its overrides are linked to source take. if I remove overrides from cloned take, original take's overrides also deleted. Is this a bug or GetClone produces a kind of instance object with linking to source object? How can I fix this? How can I break them from the source take?
- open attached c4d doc
- select Sphere take
- run this script
- script will clone sphare take under main take. Newly cloned take have 2 overrides: 1) for X location and 2) for layer properties.
- activate newly cloned Sphere take
- activate AutoTake and Lock Override buttons
- change Sphere's X location and/or sphare layer visibility values
- you will see that c4d will add another override lines under already existent overrides
import c4d # Script clones selected take to under Main Take # AliasTrans did not work #trans = c4d.AliasTrans() #if trans is None or trans.Init(doc) is False: # return False #clonedTake=selectedTake[0].GetClone(c4d.COPYFLAGS_0) #trans.Translate(False) def main(): takeData = doc.GetTakeData() mainTake=takeData.GetMainTake() selectedTake=takeData.GetTakeSelection(0) doc.StartUndo() doc.AddUndo(c4d.UNDOTYPE_CHANGE, mainTake) clonedTake=selectedTake[0].GetClone(c4d.COPYFLAGS_0) clonedTake.InsertUnder(mainTake) doc.EndUndo() c4d.EventAdd() #gui.MessageDialog('Hello World!') # Execute main() if __name__=='__main__': main()
-
RE: A problem about getting an object width value with python
@a_block I tried your suggestion and it is working.
First tag setting instance links. Tag priority: Generator and index: -1
Second tag is getting width value and sets cube position with it. priority: Generator index:0I moved user data to null object instead of using it on python tag. (Some one have suggested this before for another issue but I don't understand why we should use user data on python tag instead of object)
By the way after @zipit reply I tried to research about priority but could not find them in 3d4 doc. if you know a good page I would want to know it.
thank you both again.
-
RE: A problem about getting an object width value with python
@a_block hi,
thank you for the suggestion. I really did not think that using 2 tags instead of one. This may be work and thank you so much for this I hope it works (probably will work I'm guessing) -
RE: A problem about getting an object width value with python
@zipit hi,
thank you for your help. I tested it but in this case it can't get currently assigned linked object. Old shape assignment is staying after new shape assignment. if you have time you can see this by assigning different shape objects. -
A problem about getting an object width value with python
Hello,
I have an null container with a python tag. Object structure as below:
Null
--Loft Object
----start
----end
--cube- Python tag has a single user data that holds an object link value
- Loft object uses two instances: start and end.
- Their link values are assigned by python tag.
- and lastly I grab loft object's width value and use that value as cube object X location.
problem is when I assign new value to loftShapeLink user data I can't get loft object's width value correctly. I have to trigger python tag again and that time it runs perfectly. As you can see in sample file, after new shape assignments instance object link value is correctly assigned but width value is not updated(I got previous value).
How can I get correct width value after first execution of the script? This is a problem because I can't use takes to render scenes. Because when marked takes render is started scripts run only 1 time for active take and shape positions are not correctly rendered.
Note: I have to use null containers for shapes just because axis points. I tried only shape objects as link objects but it is not effect the result.
thank you
getting_an_object_with_issue_python.c4d