Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. delizade
    delizade

    delizade

    @delizade

    Freelance UI Designer

    0
    Reputation
    17
    Posts
    38
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Website behance.net/delizade

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    delizade Follow

    Best posts made by delizade

    This user hasn't posted anything yet.

    Latest posts made by delizade

    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?

    1. open attached c4d doc
    2. select Sphere take
    3. run this script
    4. script will clone sphare take under main take. Newly cloned take have 2 overrides: 1) for X location and 2) for layer properties.
    5. activate newly cloned Sphere take
    6. activate AutoTake and Lock Override buttons
    7. change Sphere's X location and/or sphare layer visibility values
    8. 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()
    

    test.c4d

    posted in General Programming & Plugin Discussions •
    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:0

    I 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.

    posted in Plugin Development with Cinema 4D •
    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)

    posted in Plugin Development with Cinema 4D •
    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.

    posted in Plugin Development with Cinema 4D •
    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

    1. Python tag has a single user data that holds an object link value
    2. Loft object uses two instances: start and end.
    3. Their link values are assigned by python tag.
    4. 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

    posted in Plugin Development with Cinema 4D •
    RE: How to use/import another script file in Python tag correctly?

    hi @x_nerve thank you for your time.
    code is not simple actually it has about 500 lines as far as I remember. To make scenario clear here I wrote very simple scripts. I needed to use external link for all python tags because that code is changing time to time (bug or new features etc) so with this way I change code in a single source.

    With this entry I had an "infinitely running script" problem and it was solved by removing "c4d.EventAdd()" line from external function. After this I had another issue with python tags. It was triggered whenever is changed in the scene. To prevent that I tried frame triggered python tags so with your answer it mixed with that issue below paragraph is my further step about the main topic)

    I've tried frame triggered tags but not by your way. I added null object and attach a python tag on it. This simple code watch current take changing and if take is changed it changes the frame so tags are triggered that way. Because I use takes. every take holds different data values. So when I changed active take, python tags has to be run.

    I will check your code as well currently I've been struggling with new issue about takes - user data - scene update :/
    thank you again.

    posted in Plugin Development with Cinema 4D •
    User data and take overriding issue

    Hi,
    I have a null object that has 3 user data variable on it. My take structure is like below. Every branch null object's data values are changed as mentioned below:

    • Main (data values are %1)
      ---- Step1 (data values are %2)
      ------- Step 1a_Change Data values : %10
      ------- Step 1a_Change Data values : %20
      ------- Step 1a_Change Data values : %30

    but, for example after data values are changed (while auto take and lock overrides are active) parent values are changing (Step1 and Main)

    My explanation may be confusing so you can find the scene file below. Please try to

    1. change Step1a, Step1b and Step1c (all of sub takes) and after changes go back to Step 1 and Main takes and see correct values
    2. again, try to change values of parent takes Step1a or Step1b or Step1c
      and make active Step 1 take or main take. you will see that values were changed with previous values.

    I tried to understand this behavior but I could not understand yet. could anyone know why parent take values are changing after sub take values are changed?

    (Cinema 4D Latest version)
    scene file:UserData_Take_problem.c4d

    thank you

    posted in Plugin Development with Cinema 4D •
    RE: How to use/import another script file in Python tag correctly?

    hi @r_gigante,
    I've created the scene again because I changed that workflow tons of time. You can find scene file and script. If I remove "c4d.EventAdd()" line from external code problem is gone.

    External Script file: customCode.py
    Scene file: externalPythonSample-infinity_problem.c4d

    thank you

    posted in Plugin Development with Cinema 4D •
    RE: How can I control a Python Tag's execution?

    thank you for that suggestion. I did not think that method frankly. I will try it.
    Currently I made all python tags as frame dependent. I wrote a script and assign it to a null object in my scene. This script checks current take and compare it previous one. If takes are different it changes current frame +1. In that way other python tags are running only one time.

    there is a issue but I could not achieve to solve it that as if some part of the script does not work properly :) anyway I guess your suggestion may help me rather than using frame dependent Python tags.

    thank you again.

    posted in Plugin Development with Cinema 4D •
    RE: How to use/import another script file in Python tag correctly?

    I've solved the issue
    c4d.EventAdd() was added end of my external function script. I removed it and used it in tag script. I think after that line python tag was triggered again.

    posted in Plugin Development with Cinema 4D •