Advertisement
DirectorGunner

Python Script needed for Cinema 4D parsing of prefab XMLs

Jan 29th, 2017
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. Python Script for Cinema 4D
  2. I have XMLs that are structured like this:
  3. <Object Type="Entity" Layer="Asteroids" LayerGUID="{EE80C2ED-9227-4B4A-AAE2-2511E33AB62B}" Id="{E31FE6F0-80B0-4844-B7D7-D03AE46DA6E8}" Name="AEGS_IDRIS_Bulkhead_Doors4" Pos="-10,1,29.625" FloorNumber="-1" Rotate="1,0,0,0" ColorRGB="65535" MatLayersMask="0" OutdoorOnly="0" CastShadow="1" CastShadowMinspec="1" LodRatio="100" ViewDistRatio="100" HiddenInGame="0" GlobalInSegmentedWorld="0" RecvWind="0" RenderNearest="0" NoStaticDecals="0" CreatedThroughPool="0" ShowHideUsingTimeOfDay="0" VisibleFrom="0" VisibleTo="0" EntityClass="AnimDoor">
  4. <Properties bActivatePortal="0" bLocked="0" object_Model="objects/spaceships/ships/aegs/idris_frigate/interiors/aegs_idris_bulkhead_door.cga" bNoFriendlyFire="0" soclasses_SmartObjectClass="Door" fUseDistance="5">
  5. <Animation anim_Close="close" anim_Open="open"/>
  6. <Physics Density="-1" Mass="-1" bPhysicalize="1" bPushableByPlayers="1" bRigidBody="1"/>
  7. <Sounds snd_Close="" snd_Open=""/>
  8. </Properties>
  9. </Object>
  10.  
  11. I need any python script to load a selected XML, parse all relevant data into a que/list to execute import and re-position imported objects. Execute riptide pro plugin to run (use plugin's current/previously used import settings to keep things simplier) and import file declared in XML object entity. Then once imported the python script to move the imported object to it's absolute position and rotation as stated in the same XML object entity. Then move onto next object in que/list.
  12.  
  13. Also need an error log to back track any mistakes or issues the script comes across during all the importing/moving objects such as trying to import an unsupported file type.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement