Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Lab Assistant
Original Poster
#1 Old 21st Feb 2015 at 6:35 PM
Default Play custom animation
Hello.
Is it possible now to make custom animation for SIMS 4?
1) Is there plugins for Blender, for exporting blender animation to SIMS 4?
2) Is S4PE supports animation files?
3) Is Sims 4 supports jazz files for animation?
4) How to play JAZZ animation?
5) How to play animation directly, without JAZZ (something like play single animation)?
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 21st Feb 2015 at 10:12 PM
Not sure what you mean by “supported”, but yeah there are JAZZ files in th game data and I’ve seen penty of animation-related resources in s4pe while scrolling past.

You might want to check out this thread over in Discussion, as well: http://www.modthesims.info/showthread.php?t=548775 (scrol down to the posts by dtw).

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#3 Old 21st Feb 2015 at 10:31 PM
Quote: Originally posted by plasticbox
Not sure what you mean by “supported”, but yeah there are JAZZ files in th game data and I’ve seen penty of animation-related resources in s4pe while scrolling past.

You might want to check out this thread over in Discussion, as well: http://www.modthesims.info/showthread.php?t=548775 (scrol down to the posts by dtw).


I've made animation by this guide http://www.sims4studio.com/thread/4...g-studio?page=1 and it's work nice from CAS.
But now I am searching in Sims 4 python files code, which can play my animation. I don't know terminology of the Sims 4 code - it can be named Statemachine, or Clip, or Animation... At this moment I found nothing about how to play own CLIP object from custom *.package.
Mad Poster
#4 Old 22nd Feb 2015 at 1:37 AM
I believe the way to play an animation Clip is through a Jazz file, period. I think what I would do is find a Jazz file where the sim is playing some animation similar to what the new animation is doing, and write the new one in there; then use this Jazz file as an override mod together with the new Clip.

It's also possible to write in the name or Instance ID# of your new clip instead of a Clip name already existing in a Jazz file, in which case the game would run your clip instead of the default clip. This may not be the end result you want, but it's a way of testing the animation clip to see if it runs, and also for figuring out how the Jazz file needs to be written/re-written.

MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Lab Assistant
Original Poster
#5 Old 22nd Feb 2015 at 12:08 PM
I found some JAZZ
Code:
<?xml version="1.0"?>
<ASM name="CAS">

*********************

 <Choice value="Lazy">
                                <Controller target="x" controller="@ClipController(clip=a_CAS_trait_lazy_x, loop_count=#1)" overridePosture="false" mask="" track="normal" transition_class_in="Default" transition_class_out="Default" ik_configuration="a_CAS_trait_lazy.ma" focus="undefined" id="53a9c9e6-a169-4a20-a06e-dc588b3013db">
                                    <TransitionClassList>
                                        <Transition transition_class_name="Default" transition_duration_in="0.2666667" use_custom_transition_in="true" transition_type_in="linear" transition_mask_in="" transition_duration_out="0.2666667" use_custom_transition_out="false" transition_type_out="linear" transition_mask_out="" />
                                    </TransitionClassList>
                                </Controller>
                            </Choice>

***************

But I can't understand, how to make object of asm object and how to play Lazy animation with asm
Mad Poster
#6 Old 22nd Feb 2015 at 12:31 PM
Shimrod, plasticbox or anyone - do you know if anybody has made a Jazz editor for TS4, like TigerM's SmoothJazz for TS3? I enjoyed using that and would love to be able to find something along those lines for TS4.
Pettifogging Legalist!
retired moderator
#7 Old 22nd Feb 2015 at 12:34 PM
How do you mean, editor? The one time I fiddled with a JAZZ file I simply used Notepad++ .. it's quite like XML.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#8 Old 22nd Feb 2015 at 12:41 PM Last edited by ArtUrlWWW : 22nd Feb 2015 at 12:54 PM.
Quote: Originally posted by plasticbox
How do you mean, editor? The one time I fiddled with a JAZZ file I simply used Notepad++ .. it's quite like XML.

Yep, in S4 it just XML. But XML with difficult structure...
Simpliest JAZZ with animation, what I found

Code:
<?xml version="1.0"?>
<ASM name="TipPerformer">
  <Actor name="x" type="Sim" master="true" virtual="false" />
  <Parameter name="x:age" template="age" type="enum" labels="baby,unsupported_age,child,teen,youngadult,adult,elder" default="adult" />
  <Parameter name="x:sex" template="sex" type="enum" labels="male,female" default="male" />
  <PostureManifest actors="x">  <Support family="stand" compatibility="FullBody" carry_left="*" carry_right="-" surface="*" /></PostureManifest>
  <State type="public" skippable="false" interrupt_this="false" name="TipPerformer" focus="head" facialoverlays="false" />
  <Connection from="TipPerformer" to="exit" />
  <Connection from="entry" to="TipPerformer" />
  <State name="TipPerformer">
    <description>
    </description>
    <PostureSelector parameter="x:posture">
      <Choice value="-stand-FullBody">
        <Controller target="x" controller="@ClipController(clip=a_giveTip_low_x, loop_count=#1)" overridePosture="false" mask="" track="normal" transition_class_in="Default" transition_class_out="Default" ik_configuration="a_giveTip_low_x.ma" focus="undefined" id="8">
          <TransitionClassList>
            <Transition transition_class_name="Default" transition_duration_in="0.2666667" use_custom_transition_in="true" transition_type_in="linear" transition_mask_in="" transition_duration_out="0.2666667" use_custom_transition_out="false" transition_type_out="linear" transition_mask_out="" />
          </TransitionClassList>
        </Controller>
      </Choice>
    </PostureSelector>
  </State>
</ASM>
Mad Poster
#9 Old 22nd Feb 2015 at 1:13 PM
Quote: Originally posted by plasticbox
How do you mean, editor? The one time I fiddled with a JAZZ file I simply used Notepad++ .. it's quite like XML.


This one: http://www.modthesims.info/download.php?t=365465, later updated by Peter Jones after Tiger retired from simming: http://www.simlogical.com/ContentUp...te/uploads/842/ . Unfortunately I know next to nothing about XML, guess I'll have to try to figure it out. It's just that SmoothJazz made it dead simple to make jazz overrides. Just find your state machine, make your changes, export to package, done.

Quote: Originally posted by ArtUrlWWW
Yep, in S4 it just XML. But XML with difficult structure...

That's what I was afraid of...!
Pettifogging Legalist!
retired moderator
#10 Old 22nd Feb 2015 at 1:19 PM
XML is just like the BBCode you use to make things bold or italic in forum posts – it is only markup, nothing to be afraid of. =)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#11 Old 22nd Feb 2015 at 1:52 PM
Yes, plasticbox rights. XML is very simple thing.
Mad Poster
#12 Old 22nd Feb 2015 at 4:01 PM
In the TipPerformer Jazz file shown up above, I have set in bold the name of the clip which can be replaced with some other clip, so the new one would play instead of the EA clip.

<Choice value="-stand-FullBody">

<Controller target="x" controller="@ClipController(clip=a_giveTip_low_x, loop_count=#1)" overridePosture="false" mask="" track="normal" transition_class_in="Default" transition_class_out="Default" ik_configuration="a_giveTip_low_x.ma" focus="undefined" id="8">

MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Lab Assistant
Original Poster
#13 Old 22nd Feb 2015 at 4:19 PM
Quote: Originally posted by Shimrod101
In the TipPerformer Jazz file shown up above, I have set in bold the name of the clip which can be replaced with some other clip, so the new one would play instead of the EA clip.

<Choice value="-stand-FullBody">

<Controller target="x" controller="@ClipController(clip=a_giveTip_low_x, loop_count=#1)" overridePosture="false" mask="" track="normal" transition_class_in="Default" transition_class_out="Default" ik_configuration="a_giveTip_low_x.ma" focus="undefined" id="8">


I understand it, but my question is How to play this data programmatically. Something like Animation Player.

Now I see in the code c:\Temp1\simulation\sims\sim_outfits.py some interesting code from line 206 to 231.

I made my own code, based from that code:

Code:
@sims4.commands.Command('pregnancymod.scan',  command_type=sims4.commands.CommandType.Live)
def pregnancymod_scan(opt_sim:OptionalTargetParam=None, _connection=None):
    
    pregnancymod_show_notification('!!!!!!!!! 1 +', "TEST 0 ")
    
    timeline = services.time_service().sim_timeline
    
    pregnancymod_show_notification('!!!!!!!!! 2 +', "TEST 0 ")
    
    arb = animation.arb.Arb()
    
    sim = get_optional_target(opt_sim, _connection)
    
    pregnancymod_show_notification('!!!!!!!!! 3 +', "TEST 0 ")
    
    did_change = False

    def set_ending(*_, **__):
        nonlocal did_change
        if not did_change:
            pregnancymod_show_notification('ANIMATION DONE!!!', "ANIMATION DONE!!!")
            did_change = True
            
    arb.register_event_handler(set_ending, handler_id=100)
    
    clothing_context = animation.get_throwaway_animation_context()
    
#    clothing_change_asm_MAIN = TunableResourceKey(None, resource_types=[sims4.resources.Types.STATEMACHINE], description='ASM used for the clothing change MY.')
    
    pregnancymod_show_notification('!!!!!!!!! 4 +', "TEST 0 ")
    
    clothing_change_asm = animation.asm.Asm(ClothingChangeTunables.clothing_change_asm, context=clothing_context)
    
    pregnancymod_show_notification('!!!!!!!!! 5 +', "TEST 0 ")
    
    DEFAULT_ACTOR = 'x'
    
    pregnancymod_show_notification('!!!!!!!!! 6 +', "TEST 0 ")
    
    sim.posture.setup_asm_interaction(clothing_change_asm, sim, None, 'x', None)
    
    pregnancymod_show_notification('!!!!!!!!! 7 +', "TEST 0 ")

It works until
Code:
pregnancymod_show_notification('!!!!!!!!! 4 +', "TEST 0 ")

and looks like failed on
Code:
clothing_change_asm = animation.asm.Asm(ClothingChangeTunables.clothing_change_asm, context=clothing_context)

I need to find, where is Sims 4 debug log for investigation, why it's fails.
Lab Assistant
Original Poster
#14 Old 22nd Feb 2015 at 5:06 PM
Now I found, that code

Code:
    try:
#        clothing_change_asm = animation.asm.Asm(ClothingChangeTunables.clothing_change_asm, context=clothing_context)
        clothing_change_asm = animation.asm.Asm(clothing_change_asm_MAIN, context=clothing_context)
    except Exception as inst:       
       filename = "C:/temp/qqqqqqqqq.log"
       with open(filename, "a") as fp:
           fp.write('{}\n'.format(inst))
           traceback.print_exc(file=fp)


will rise exception

Code:
ASM key is not of instance str or ResourceKey
Traceback (most recent call last):
  File "c:\temp\dgdg\myPlugin\src\PregnancyMegaMod.py", line 139, in pregnancymod_scan
    clothing_change_asm = animation.asm.Asm(clothing_change_asm_MAIN, context=clothing_context)
  File "T:\InGame\Gameplay\Scripts\Server\animation\asm.py", line 251, in __init__
TypeError: ASM key is not of instance str or ResourceKey


Interesting, why? Why it work good in outfit and doesn't work in my code?
Lab Assistant
Original Poster
#15 Old 22nd Feb 2015 at 6:49 PM
Got some news.
My code
Code:
def get_change_outfit_element():
        timeline = services.time_service().sim_timeline

        def change_outfit(timeline):
            arb = animation.arb.Arb()
            
            sim = get_optional_target(opt_sim, _connection)
            
            pregnancymod_show_notification('!!!!!!!!! 3 +', "TEST 0 ")
            
            did_change = False

            def set_ending(*_, **__):
                nonlocal did_change
                if not did_change:
                    pregnancymod_show_notification('ANIMATION DONE!!!', "ANIMATION DONE!!!")
                    did_change = True
                    
            arb.register_event_handler(set_ending, handler_id=100)
            
            clothing_context = animation.get_throwaway_animation_context()
            
            pregnancymod_show_notification('!!!!!!!!! 4 +', "TEST 0 ")
            
        #    filename = "C:/temp/qqqqqqqqq.log"
        #    with open(filename, "a") as fp:
        #           fp.write('{}\n'.format("START"))
                   
        #    pregnancymod_show_notification('!!!!!!!!! 4.5 +', "TEST 0 ")
            
        #    try:
        #        clothing_change_asm = animation.asm.Asm(asm_key="ClothesChange", context=clothing_context)
        #    except Exception as inst:       
        #       filename = "C:/temp/qqqqqqqqq.log"
        #       with open(filename, "a") as fp:
        #           fp.write('{}\n'.format(inst))
        #           traceback.print_exc(file=fp)       
            
            clothing_change_asm = animation.asm.Asm(asm_key="ClothesChange", context=clothing_context)
            
            pregnancymod_show_notification('!!!!!!!!! 5 +', "TEST 0 ")
            
            DEFAULT_ACTOR = 'x'
            
            pregnancymod_show_notification('!!!!!!!!! 6 +', "TEST 0 ")
            
            sim.posture.setup_asm_interaction(clothing_change_asm, sim, None, 'x', None)
            
            pregnancymod_show_notification('!!!!!!!!! 7 +', "TEST 0 ")
            
            pregnancymod_show_notification('!!!!!!!!! 8 +', "TEST 0 ")
            
        #    try:
        #        clothing_change_asm.request("ClothesChange", arb)
        #    except Exception as inst:       
        #       filename = "C:/temp/qqqqqqqqq.log"
        #       with open(filename, "a") as fp:
        #           fp.write('{}\n'.format(inst))
        #           traceback.print_exc(file=fp)       

            clothing_change_asm.request("ClothesChange", arb) 
            pregnancymod_show_notification('!!!!!!!!! 9 +', "TEST 0 ")
            
            if not arb.empty:
                pregnancymod_show_notification('!!!!!!!!! arb NOT empty!!!', "TEST 0 ")
                clothing_element = create_run_animation(arb)
                pregnancymod_show_notification('!!!!!!!!! create_run_animation +', "TEST 0 ")
                yield element_utils.run_child(timeline, clothing_element)
        #        try:
        #            element_utils.run_child(timeline, clothing_element)
        #        except Exception as inst:       
        #           filename = "C:/temp/qqqqqqqqq.log"
        #           with open(filename, "a") as fp:
        #               fp.write('{}\n'.format(inst))
        #               traceback.print_exc(file=fp)       

        #        yield element_utils.run_child(timeline, clothing_element)
                pregnancymod_show_notification('!!!!!!!!! run_child +', "TEST 0 ")
        #    else:
                pregnancymod_show_notification('!!!!!!!!! arb empty!!!', "TEST 0 ")

        return change_outfit


@sims4.commands.Command('pregnancymod.scan',  command_type=sims4.commands.CommandType.Live)
def pregnancymod_scan(opt_sim:OptionalTargetParam=None, _connection=None, sequence=()):
    
    pregnancymod_show_notification('!!!!!!!!! 1 +', "TEST 0 ")
    
    timeline = services.time_service().sim_timeline
    
    pregnancymod_show_notification('!!!!!!!!! 2 +', "TEST 0 ")
    
    start_change = build_critical_section(get_change_outfit_element(), flush_all_animations)
    
    pregnancymod_show_notification('!!!!!!!!! 10 +', "TEST 0 ")
    
    sequence = build_critical_section(start_change, sequence)
    
    pregnancymod_show_notification('!!!!!!!!! 12 +', "TEST 0 ")
    
    try:
        timeline.run_child(sequence)
    except Exception as inst:       
       filename = "C:/temp/qqqqqqqqq.log"
       with open(filename, "a") as fp:
           fp.write('{}\n'.format(inst))
           traceback.print_exc(file=fp)   
    
#    timeline.run_child(sequence)
    
    

    pregnancymod_show_notification('!!!!!!!!! 14 +', "TEST 0 ")

Now throws
Code:
'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "c:\temp\dgdg\myPlugin\src\PregnancyMegaMod.py", line 205, in pregnancymod_scan
    timeline.run_child(sequence)
  File "T:\InGame\Gameplay\Scripts\Server\scheduling.py", line 421, in run_child
TypeError: 'NoneType' object is not subscriptable

Any ideas?
Instructor
#16 Old 21st Nov 2016 at 4:23 PM Last edited by Dramatic-Gamer : 24th Nov 2016 at 4:03 PM.
Did this work for You ? I'm trying so hard to create a custom ASM & link it to a custom interaction using an animation tuning

EDIT: I finally figured out how to do it & it was really simple

. I am a 20 years old male ..I'm not a Female .. and my name is not Bella .. as everybody think .
I used to bite .. but i don't do that anymore . Have fun! :)

Lab Assistant
Original Poster
#17 Old 9th Mar 2017 at 10:10 PM
@Dramatic-Gamer, how you done it? With Python? Can you show your code? Thank you!
Back to top