Handful of sequence data contains incorrect values when loading the saved project

Hi people!


I ran into a problem where my values of sequence data are not correct when you open a project with an instance of my effect plugin.

The values look good if I manually inspect when they are flattened and written in a fine when handle memory and restore AE sends PF_Cmd_SEQUENCE_RESETUP once the backup is complete.  But when I open / load the saved project, the values are not correct.  In other words, my logic flattening/unflattening works within the same session, but during the loading of a saved project, the flattened data is incomplete or has bad values.

I write several objects to the handful of flat sequence data, and I was wondering if this could be the cause.

The flattened sequence data manage memory looks like this:

[[type struct A] [type struct b] [b] of type struct] [struct type b] <.. .arbitrary number of struct type BS... >]

NB of struct type B varies, so when I ask AE for a handle of memory, I have this:

size_t flatSequenceDataSize = sizeof(structTypeA) + (sizeof(structTypeB)* numberOfBStructsNeeded);
PF_Handle flat_seq_dataH = suites.HandleSuite1()->host_new_handle(flatSequenceDataSize);


Then, to write the data to the handle:

structTypeA myDataA = <... populate struct values ...>
std::vector<structTypeB> allStructB_V;
<... populate vector ...>

void *flat_seq_dataP = suites.HandleSuite1()->host_lock_handle(flat_seq_dataH);

structTypeA *structA_P = reinterpret_cast<structTypeA*>(flat_seq_dataP);
memcpy(flat_seq_dataP, &myDataA, sizeof(structTypeA));

structTypeB *structB_P = reinterpret_cast<structTypeB*>(flat_seq_dataP);

//offset pointer by the size of the first struct in the handle
structB_P += sizeof(structTypeA);

for (A_long vectorIndex=0; vectorIndex < allStructB_V.size(); vectorIndex++) {
    *structB_P = allStructB_V.at(vectorIndex);
    structB_P+= sizeof(structTypeB);
}

out_data->sequence_data = flat_seq_dataH;
suites.HandleSuite1()->host_unlock_handle(flat_seq_dataH);


When I access the handful of sequence data loading stage, the first struct in the flattened handle has correct values, but all following structs have false values.  I check if the handle is always the right size (I save the size of the handle inside the first structure) and it is indeed the correct size.  I wonder if AE doesn't like how I write from the structB to the handle.

I'm doing something wrong here?  Is there a better way to store data of arbitrary sizes?

Thanks for your help!

-Andy

Ah, I missed actually a significant error in your pointer arithmetic! You're actually in the land of UB ("undefined behavior") with your code!

You add byte offsets to a pointer type, which is doomed to failure if you don't know what you're doing.

If you have

structTypeB * structB_P = reinterpret_cast(flat_seq_dataP);

and do you

structB_P += sizeof (structTypeA);

most of compiler that turn into something like this:

structB_P = (structTypeB *) ((unsigned char*) + sizeof (structTypeA) * sizeof (structTypeB));

Wrong in your case (in most cases actually).

Or more simple put:

If you have a pointer

structTypeB * structB_P =...

and you do:

structB_P += 3;

It actually means

structB_P = strucB_P + 3 * sizeof (structTypeB);

already!

Try running your pointer to an unsigned char * or another type of 1 byte basis and then make the increment, and then recast.

Here's a site with more information on this:

http://StackOverflow.com/questions/15934111/portable-and-safe-way-to-add-byte-offset-to-an y-pointer

It could then look like this (on the top of my head, did not check!):

void * flat_seq_dataP = suites. HandleSuite1()-> host_lock_handle (flat_seq_dataH);

structTypeA * structA_P = reinterpret_cast(flat_seq_dataP);

memcpy (myDataA, sizeof (structTypeA) & flat_seq_dataP);

structTypeB * structB_P = reinterpret_cast(reinterpret_cast(flat_seq_dataP) + sizeof (structTypeA));

memcpy (structB_P, allStructB_V.data (), sizeof (structTypeB) * allStructB_V.size ());

out_data-> sequence_data = flat_seq_dataH;

Suites. HandleSuite1()-> host_unlock_handle (flat_seq_dataH);

Tags: After Effects

Similar Questions

  • 4.2.3/.4 data support assistant - slow when loading large files

    Hello

    I use the load data wizard to load csv files into an existing table. It works very well with small files up to a few thousand rows. When loading 20 k lines or more loading process becomes very slow. The table has a unique numeric column to the primary key.

    The primary key is declared to the "shared components"-> logic-> "data loading tables" and is recognized as 'pk (number)' with 'case sensitve' set to 'No '.

    When loading the data, these Setup executes the following query for each line:

    Select 1 "Klaus". "' PD_IF_CSV_ROW ' where upper ("PK") = upper(:uk_1)

    which can be found in v$ sql view during loading.

    It makes the process of slow loading because of the superior function, no index can be used.

    It seems that the setting of "case sensitive" is not rated.

    Removing the numeric index for the key primary and with the help of a function based index do not help.

    Explain plan shows an implicit conversion "to_char":

    UPPER (TO_CHAR (PK) = UPPER(:UK_1)

    It is missing in the request, but perhaps that it is necessary for the function based index to work.

    Please provide a solution or workaround to load data Wizard work with large files in a reasonable time.

    Best regards

    Klaus

    You must have the correspondence of PK to be "exactly - case-sensitive" (or something like that)

    In addition, I was already on the slowness with Oracle Support when dealing with important content.

    They are aware of the problem.  Only around is known to break up the data into smaller segments.

    (I'll have to track down the correct ID for reference...)

    My observation:

    APEX data loader makes a slow-by-slow transformation of the data instead of treatment in bulk.

    You will need to break up the data, or to build your own data loader.

    Thank you

    MK

  • How to complete the list of values when loading screen

    Hi all

    I have a list of values based on another field (ANOTHER_FIELD).

    for example
    Select the value d, r
    from table_name
    where id =: ANOTHER_FIELD;

    ANOTHER_FIELD has a default value.

    But when the screen is opened to the list of values does not have the default value and the values list is empty.
    Just when it is filled with submission of the form, the list of values.

    Please tell me how can I complete the list of values when loading screen.

    Thank you!

    Hello

    It depends on how you have defined the default value for ANOTHER_FIELD.

    I always set my default settings using a calculation, that runs before header, on the element that defines the value using a static assignment, but to ensure that the calculation is dependent on the order of the day being NULL - try this

    Andy

  • I continued to have this message flashing on the screen "ERROR of LOADING of THE OPERATING SYSTEM" after the restart when loading the software Window XP.

    Original title: someone help please?

    Working on my old computer, a pentium 4, card mother GA81PE1000, I continued to have this message flashing on the screen "ERROR of LOADING of THE OPERATING SYSTEM" after the restart when loading the software Window XP. After so many years, working on the construction of computer & repair, it's new to me.

    So I checked the Microsoft Website for answers from people with the same problem in the past and apply their suggestions, nothing works... hard drive replaced, the changed value in the bios, did everything possible, still nothing works, phenomenal for me, please help me find an answer, thank you?

    Hello

    1. have you made changes on the computer before this problem?
    2 - what you want to say that you receive this error message during the installation of Windows XP?

    Check to see if the following is useful.

    Method 1: Disconnect all devices non-essential connected to the computer and restart. Check to see if it boots normally.

    Method 2: You may need to check the settings of the BIOS (Basic Input\Output System). Check if the hard drive is detected. If this is not the case, check the physical connections. Refer to the manual to check the same.

    Warning of the BIOS:

    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

    The following article might be useful: "Error loading operating system" Error Message When you restart your computer during installation

  • Run the code once when loading the form

    Hi guys,.

    I have a text field (TextField1), which fills with a value (1-100)

    During the initial loading of the form, this value will be the highest.

    When the user navigates around the shape, this number will change (lower than initial load)

    I have another text field (TextField2) on the form I want to keep the original value to the loading of the form.

    something like: TextField2.rawValue = TextField1.rawValue

    But any event that I put in it always updates TextField2 with TextField1 value (not does not run the code once when loading the form)

    Can someone tell how can I do this?

    If the form is loaded with the number 70 as a value in TextField1 - TextField2 has 70 as a value and maintains this value regardless of what TextField1 goes to...

    Thanks a lot for any help

    try putting in the TextField2 docReady event:

    $ = TextField1.rawValue

  • Satellite L675-11R - crashes when loading the BIOS

    Hello

    My daughter L675 crashes when loading the BIOS.

    Yesterday the system firstly could not start with a "Boot failed" error, as the HARD drive is not found.

    I restarted and is gone in BIOS - the HARD disk was recorded and shown as a first Source of seed. After reboot, the system has failed again with the same error.

    After several attempts, even if it does not. now that appears in a black screen, blinking cursor top left. Hot start works, but another key not seem to provoke a reaction. I can't start the BIOS Setup.

    I removed the HARD drive and connected it to my PC. It was recoginized and I am able to write to it. A W7 disk verification completed successfully and some problems have been "fixed". But when I reinstall the drive of the laptop, it still does not start.

    I double checked that the drive & Modules of memory are well inserted.

    Any ideas I can try?

    Thank you

    John

    Well, the cursor blinking in the upper left corner is a typical sign of a malfunction of the HARD drive.
    I think you need to format the HARD drive using other computers. Delete all partitions and insert the HARD drive into the L675 again.
    Then try to install the Windows system on this device.

    In addition, you can try to check this HARD disk using a 3rd party software.
    Drive Fitness Test is a free tool that can help you test the ability of the HARD drive.
    If some errors would be detected, then a replacement HARD drive would be desirable.

  • Photoshop cs5 crashes on launch when loading the brushes

    Photoshop cs5 crashes on launch when loading the brushes.  I have to do a hard reboot and reset the preferences.  In the last 2 days I had to do it 3 times.  I have the latest drivers.  Here's my hardware.  I'm also under lightroom.  I don't have this problem after I installed the latest updates on the adobe Web site. Does anyone have information on a fix for this problem thank you very much for your time.

    Nancy Cuppy

    system info.jpg

    I guessed it was a later part of the process and loading brushes was just the last thing as shown.

    Could you send me a copy of this file corrupt brushes?  I would like to know how he could cause the launch to hang.

    ccox at adobe dot com.

  • Red Apple icon shown when loading the software containing the two Vista and Apple software - does not recognize Windows

    I recently bought 2 bits of software that contain the Apple and Microsoft (Vista) versions on one CD.  When I insert the CD into my Vista PC, it can not find or load the installation files.  Instead, if I look at what is on the drive, I see an icon of the Red Apple.  If I put the same CD on Vista PC to my wife, it loads correctly.  If I load the version of WIndows 7 software, it loads correctly and run the program until he acknowledges that the operating system is Vista not Windows 7.  Something triggered something on my Vista PC to do brand new loading on my CD player program needs to ignore files in vista and show files apple as if they were independent.  Is there a toggle for this problem?  If I run the software of Microsoft ' Fix It' - the solution that I see on most boards, it does not.  As far as I know, other Vista users are facing this problem without solution by MIcrosoft or any other tech tips.

    The problem is with a program from Mediafour.  It's called xplay 3.  If you uninstall this program, everything works fine.

  • Photoshop crashes when loading the files to stack

    Hello

    When I try to load a stack, Ps load the sequence of jpg files, then freezes and goes to the start screen.

    I have compiled successfully a pile of these sequences of 300 + images previously (I just need to re - export an animated .gif updated).

    I tried to restart, execution of a disk cleanup, restarting after a period of time are done everything to nothing.

    If anyone has any ideas, I'd be really interested to hear!

    Thank you & all the best.

    Strangely, I've just been through the process of cleaning disc again and this time it seems to have solved the problem.

    Thanks for your help - I hope that this thread can be useful to someone else who has this problem.

  • Satellite Pro A10: Error when loading the drivers and other things

    Hello.
    I just bought a spare A10 to ebay. I already have an A10 and the company. Powering up the new A10, I have a bubble message from microsoft saying that it was unable to load the drivers for the cd burning software, please update the drivers. If I click on the bubble it says to update of real player, roxio or other recording software.

    As I did not immediately and there not there when bought. Its not broken, its all just annoying. Also when I right click anywhere on the desktop, in the coloum that you see, I get a link to an adult site, how can I get rid of this?

    I want to thank you for taking the time to read this and would be grateful if you could help.

    Jack.

    Hi Jack,

    I suggest you to check what is actually underway when you start your new A10 using MSCONFIG. This will then stop these tasks that you do not want to be started up and should prevent your error message displayed.

    I also suggest you download and install a copy of AdAware http://www.lavasoft.com (and perhaps also http://www.spybot.info/en/download/index.html SpyBot) and do a check complete of your new A10 to remove any nasties that may be hiding there.

    It seems that if the previous owner has removed some of the software they had installed, but is not completely cleaned afterwards.

    Finally, I personally use a freeware CCleaner http://www.ccleaner.com/ for utility call which is excellent to remove the pieces left over on my laptop. It must be treated with some caution, because it is a powerful utility, but it is very quick and thorough.

    Kind regards

  • Have a program in which a sub front vi appears when loading the vi main

    I have a strange problem.

    • This problem takes place only after construction of an application using LV 8.6 Application Builder Professional version, and I installed it on the target computer. It occurs when you run the development system.
    • When I load the program on the target computer, one of the panels before Subvi used in the application appears at the top of the façade of the vi main.
    • The Subvi should never appear on the front panel at any time during the exicution program.
    • It happens to be Spreadsheet.vi writing that belongs to the standard library of vi.
      • I checked all calls to this sub - VI to check that there not be changed to make it load or appear when loading of the vi main.
      • It is called 4 different times during the exicution program but in no case is it set to display the front panel.

    Someone has seen this and if so what was the solution?

    Problem solved.  I copied the writing to Spreadsheet.vi from another computer.  Then, I went into the program and replaced vi in each place they called him.  The program now works as expected.

  • Incorrect behavior when using the sliders on a signal enlarged

    I started recently by using sliders to determine specific values in a recorded signal.

    Problem is when I use the Zoom tool (the magnifying glass under the time scale icon inside) to zoom in on a specific peak dysfunction of sliders. When you take a slider handle and drag the intersection of cursor is no longer follows the track of the signal in the graph.

    To recreate:

    • Log data with Signal Express seconds. I always pass the signal by the amplitude and levels step to display the signal as a graphic of the scope.

    • Right-click on the graph and select visible items > sliders to add the sliders to the chart

    • Use the handles to slide to move the cursor cross along the signal.

    • Click the magnifying glass in the time scale, and then select the Zoom (top left of the box that is displayed)

    • Click and drag on the chart to zoom in on a signal peak.

    • Now use the grab handle sliders intersect on the zoomed pic in.

    • Cursors follow the path of the signal.

    I'm pretty confident that it's recreateable, because the same behavior exists on both machines in the lab as well as the software in beta 2011 at my office.

    Rory,

    Thank you for your patience during the attempt to isolate this problem. I'm glad that you could see up to a kind of stange behavior.

    You describe exactly what I see on my end. If you zoom in far enough the sliders 'think' it follows the signal when in fact it's a ghost left by an already enlarged resolution signal.

    The solution is to change the graphic for graphic band momentarily while I use the sliders, and then back again to view the actual data.

    This isn't really a drawback, but I'm happy that we can document as a bug.

    Thank you!

  • Prevent freezing when loading the data in the table of GUI

    I am receiving messages via a TCP/IP connection.  Information of these messages are retrieved and displayed in a table, as they are received.  Number of messages is received over a short period of time, and a large amount of data is added to the table.  When this happens, the freezing of MISTLETOE and the user cannot press the Cancel button until all the data are inserted into the table.  How could I prevent this gel?

    I studied this forum and I found a few tips, but they did not help.  I used SetCtrlAttribute instead of SetCtrlVal to update the table.  Using SetCtrlAttribute to enter the information in the table slightly reduces the gel as the table is redrawn only once all information is entered in the table.

    Problem solved: I created and executed the TCP client in a separate UI thread

  • Failed to retrieve attribute values when executing the validation on update

    IAM trying to do validation on user create and update operations:

    currently able to perform validations on iam create user operation
    (Note: my validations require organization name which iam get using form user act_key only)

    but when I try to trigger the same code for update, it do not recover key, infact the same code does not even get attribute values.
    given that I don't get any key of the organization. together to update validation failed.

    My EventHandler.xml looks like this:
    < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" >

    <!--> custom validation event handlers
    <-validation Manager
    Class = "test. IOM. EventHandler.UserFormFieldValidation ".
    entity-type = 'User '.
    operation = "CRΘER."
    name = "UserFormFieldValidation".
    order = "1000" / >

    <-validation Manager
    Class = "test. IOM. EventHandler.UserFormFieldValidation ".
    entity-type = 'User '.
    operation = 'CHANGE '.
    name = "UserFormFieldValidation".
    order = "1000" / >
    < / eventhandlers >

    Please suggest what needs to be done in this case.
    Note: iam using the same code for postings of these two operations (operation to create and update the operation of user profile)

    Thanks in advance

    as mentioned above:
    get the key of the user and then get the name of the organization.

    You can get the params modifed by using:
    HashMap orchVal = orch.getParameters ();

    You can use this to get the fields that you can still use to your validation.

    Note: If you change an attribute and do not send any value he always added to the card with the value null.

    It may be useful

  • How do I dynamicaly create TestStand properties when loading the limits of an Excel file using the property loader?

    Hello

    I need help using the shipper of the property. I have an excel file that contains a bunch of properties, and the properties change quite often. I want to be able to load a picture of the excel file properties by using the shipper of the property and create these properties in Teststand programmatically. It is a sample of the file I want to import: when I tried the charger of the property, I got an error, because the properties did not exist. So, how can I create them as they load?

    LIMITS OF DEPARTURE 
     
      
    Value of the variable
      
    Value of the variable
    LowLimits10 20 30
    PinNumbers0 1 2
      
    Value of the variable
    LIMITS OF THE END 

    Thank you

    Ayman

    Thanks Ric, Ray. Both of your comments, I was able to do that the tool works exactly as I want. The final version of my custom tool is attached.

Maybe you are looking for