- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Play custom animation
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Play custom animation
Replies: 16 (Who?), Viewed: 4810 times.
#1
21st Feb 2015 at 6:35 PM
Posts: 133
Thanks: 1494 in 13 Posts
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
#2
21st Feb 2015 at 10:12 PM
Posts: 11,006
Thanks: 423050 in 1121 Posts
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.
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.
#3
21st Feb 2015 at 10:31 PM
Posts: 133
Thanks: 1494 in 13 Posts
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.
#4
22nd Feb 2015 at 1:37 AM
Posts: 3,552
Thanks: 55573 in 750 Posts
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/
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/
#5
22nd Feb 2015 at 12:08 PM
Posts: 133
Thanks: 1494 in 13 Posts
I found some JAZZ
But I can't understand, how to make object of asm object and how to play Lazy animation with asm
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
#6
22nd Feb 2015 at 12:31 PM
Posts: 4,161
Thanks: 70057 in 93 Posts
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.
#7
22nd Feb 2015 at 12:34 PM
Posts: 11,006
Thanks: 423050 in 1121 Posts
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.
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.
#8
22nd Feb 2015 at 12:41 PM
Last edited by ArtUrlWWW : 22nd Feb 2015 at 12:54 PM.
Posts: 133
Thanks: 1494 in 13 Posts
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>
#9
22nd Feb 2015 at 1:13 PM
Posts: 4,161
Thanks: 70057 in 93 Posts
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...!
#10
22nd Feb 2015 at 1:19 PM
Posts: 11,006
Thanks: 423050 in 1121 Posts
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.
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.
#11
22nd Feb 2015 at 1:52 PM
Posts: 133
Thanks: 1494 in 13 Posts
Yes, plasticbox rights. XML is very simple thing.
#12
22nd Feb 2015 at 4:01 PM
Posts: 3,552
Thanks: 55573 in 750 Posts
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/
<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/
#13
22nd Feb 2015 at 4:19 PM
Posts: 133
Thanks: 1494 in 13 Posts
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.
#14
22nd Feb 2015 at 5:06 PM
Posts: 133
Thanks: 1494 in 13 Posts
Now I found, that code
will rise exception
Interesting, why? Why it work good in outfit and doesn't work in my 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?
#15
22nd Feb 2015 at 6:49 PM
Posts: 133
Thanks: 1494 in 13 Posts
Got some news.
My code
Now throws
Any ideas?
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?
#16
21st Nov 2016 at 4:23 PM
Last edited by Dramatic-Gamer : 24th Nov 2016 at 4:03 PM.
Posts: 453
Thanks: 21139 in 213 Posts
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! :)
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! :)
#17
9th Mar 2017 at 10:10 PM
Posts: 133
Thanks: 1494 in 13 Posts
@Dramatic-Gamer, how you done it? With Python? Can you show your code? Thank you!
Who Posted
|